This function works as intended in Firefox, but not IE 6 or Opera.

B

Bob

I have a small JS function to edit "code". This function works as
intended in Firefox, but not IE 6 or Opera 9. I suppose this is an old
story, but is there a work around? I have two forms on the page,
passing one by argument, and the other "GetClass" is hard coded. I'm
trying to prevent my DB from having the same code, unless it is "ZZZ".
This function is called with an onChange event in the input field
"newcode".

function checkcode(aform) {
var code =aform.newcode.value.toUpperCase()
if (code=="ZZZ") return
newopt = aform.newclass.valueto.UpperCase() + " | " + code;
for (i=0; i<document.GetClass.key.length; i++) {
k= document.GetClass.key.options.value.indexOf(code);
if ((k>0) && (document.GetClass.key.options.value !== newopt))
alert("Warning: This Class Code is already used by " +
document.GetClass.key.options.value)
}
}
 
B

Bob

This is just a typo
newopt = aform.newclass.valueto.UpperCase() + " | " + code;

I really do have this is the JS:

newopt = aform.newclass.value.toUpperCase() + " | " + code;
 
B

Bob

This is just a typo
newopt = aform.newclass.valueto.UpperCase() + " | " + code;

I really do have this is the JS:

newopt = aform.newclass.value.toUpperCase() + " | " + code;
 
B

Bob

I have a small JS function to edit "code". This function works as
intended in Firefox, but not IE 6 or Opera 9. I suppose this is an old
story, but is there a work around? I have two forms on the page,
passing one by argument, and the other "GetClass" is hard coded. I'm
trying to prevent my DB from having the same code, unless it is "ZZZ".
This function is called with an onChange event in the input field
"newcode".

function checkcode(aform) {
var code =aform.newcode.value.toUpperCase()
if (code=="ZZZ") return
newopt = aform.newclass.value.toUpperCase() + " | " + code;
for (i=0; i<document.GetClass.key.length; i++) {
k= document.GetClass.key.options.value.indexOf(code);
if ((k>0) && (document.GetClass.key.options.value !==
newopt))
alert("Warning: This Class Code is already used by " +
document.GetClass.key.options.value)
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top