monaya
03-03-2009, 10:00 PM
I'm disbaling a submit button on submit and validating some info. I'm trying to enable it again if the user fails authentication to re-enter data. Here is my code. Seems to work in Safari, IE but not Mozilla.
<script language="javascript">
function submitform()
{
if (document.getElementById("code").value != "4343")
{
window.alert("incorrect code. try again.");
document.getElementById("btnsubmit").value = "Send Feedback";
document.getElementById("btnsubmit").disabled = false;
return false;
}
else
{
document.form1.submit();
}
}
</script>
<input type="button" name="btnsubmit" id="btnsubmit" value="Send Feedback" onClick="this.value='Please wait...';this.disabled = true;submitform();"/>
it worked once, then when I rechecked it, the button stays disabled after a failed authentication? I hate when that happens because I implement the code all over!
<script language="javascript">
function submitform()
{
if (document.getElementById("code").value != "4343")
{
window.alert("incorrect code. try again.");
document.getElementById("btnsubmit").value = "Send Feedback";
document.getElementById("btnsubmit").disabled = false;
return false;
}
else
{
document.form1.submit();
}
}
</script>
<input type="button" name="btnsubmit" id="btnsubmit" value="Send Feedback" onClick="this.value='Please wait...';this.disabled = true;submitform();"/>
it worked once, then when I rechecked it, the button stays disabled after a failed authentication? I hate when that happens because I implement the code all over!