Link to home
Start Free TrialLog in
Avatar of Erikal
Erikal

asked on

how to make onsubmit disable=false;

Hellp experts
I have a timed multiple choice test, where each question is set with radio buttons.
I also have a timeout function which disables the radio buttons when the time runs out, so that the user can not edit the answers or enter new answers.

However, when the user clicks the submit button at the end, I want to pass the answers to the database.
In other words I need to achieve; onSubmit disabled=false;

Could anyone tell me how to do this. If I need to add this to the <Form.......      > element, what is the syntax for doing this?

Here is the Javascript code for disabling the radio button at timeout:

-------------------

script type="text/javascript">
      window.onload=initeng;
      function initeng(){
            var mineng=15;
            setTimeout("engPage()", 1000*60*mineng );
      }
      function engPage(){
            //assuming you have <form id="English1"...>
            var f = document.getElementById("English1");
            for( var i=0; i < f.elements.length; ++i)
            {      if(String(f.elements[i].type).toLowerCase() != "submit" )
                     {
                           f.elements[i].style.color="#aaaaaa";
                        f.elements[i].disabled=true;
                        }
      }
      }
</script>
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial