By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,934 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,934 IT Pros & Developers. It's quick & easy.

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

P: n/a
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[i].value.indexOf(code);
if ((k>0) && (document.GetClass.key.options[i].value !== newopt))
alert("Warning: This Class Code is already used by " +
document.GetClass.key.options[i].value)
}
}

Oct 1 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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;

Oct 1 '06 #2

P: n/a
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;

Oct 1 '06 #3

P: n/a
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[i].value.indexOf(code);
if ((k>0) && (document.GetClass.key.options[i].value !==
newopt))
alert("Warning: This Class Code is already used by " +
document.GetClass.key.options[i].value)
}

Oct 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.