Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    works on Internet Explorer not on Mozilla

    I have a function that validates the input onChange().In case of an error the function gives an alert message and keeps the focus on the same text box.I achieve this by the following snippet of code in the function using
    if (alertbox!="") {alert(alertbox); entered.select(); entered.focus();
    This worlks on Internet Explorer but does not on mozilla...

    Please Help me on this....

    Thanks

    In case I am not clear I am attaching the code and the function call

    Fuunction Call:
    onChange="return numberValidation(this,1,10,'The Number Of Elements should be an Integer within the Range ','Integer'

    Function

    function numberValidation(entered, min, max, alertbox, datatype)
    {
    with (entered)
    {
    checkvalue=parseFloat(value);
    if (datatype)
    {smalldatatype=datatype.toLowerCase();
    if (smalldatatype.charAt(0)=="i")
    {checkvalue=parseInt(value); if (value.indexOf(".")!=-1) {checkvalue=checkvalue+1}};
    }
    if ((parseFloat(min)==min && value.length<min) || (parseFloat(max)==max && value.length>max) || value!=checkvalue)
    {if (alertbox!="") {alert(alertbox); entered.select(); entered.focus();
    } return false;}
    else {return true;}
    }
    }

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I don't think that onChange is supported by mozilla... Not sure, but I heard that somewhere.

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    I don't think so. Check if there are errors in Javascript console


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •