Incompatibility between IE & Firefox when disabling Submit button?

Discussion in 'JavaScript' started by PedstersPlanet, Aug 11, 2009.

  1. #1
    Ok, I've an issue with Internet Explorer, Firefox works though, with disabling the submit button on one click.


    Senario:
    Firstly, the button is disabled until they click on a select box option, then it enables the submit button, they click the submit button once then it disables itself.


    Heres my code:


    Function:
    function setItems(o)
    { 
     var total = 0;
     for (i = 0; i < o.options.length; i++) {
      if (o.options[i].selected) total++;
      if (total > <? echo $num; ?>) o.options[i].selected = false;
     }
      document.timetable.submit.disabled=false;
    }
    Code (markup):
    Select box:
    <select name="setmain[]" multiple="true" size="20" id="setmain[]" onclick="setItems(this)">
    Code (markup):
    Submit button:
    <input type="submit" name="submit" value="Book Set(s)" onclick="this.disabled=true" disabled>
    Code (markup):
    Problem: People report that when using Internet Explorer, the submit button won't actually submit the form... But when they try in Firefox, it submits! :confused:

    Any ideas?
     
    PedstersPlanet, Aug 11, 2009 IP