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

Discussion in 'Javascript' started by Bob, Oct 1, 2006.

  1. Bob

    Bob Guest

    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)
    }
    }
     
    Bob, Oct 1, 2006
    #1
    1. Advertising

  2. Bob

    Bob Guest

    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;
     
    Bob, Oct 1, 2006
    #2
    1. Advertising

  3. Bob

    Bob Guest

    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;
     
    Bob, Oct 1, 2006
    #3
  4. Bob

    Bob Guest

    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)
    }
     
    Bob, Oct 1, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Dalberg
    Replies:
    29
    Views:
    4,125
    kchayka
    Nov 3, 2004
  2. Bob
    Replies:
    24
    Views:
    1,549
  3. Jeff
    Replies:
    3
    Views:
    1,133
  4. patrickkellogg
    Replies:
    3
    Views:
    163
  5. Replies:
    2
    Views:
    121
    Peter Michaux
    Jun 6, 2007
Loading...

Share This Page