Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.
Hello,
I have two scripts that I would like to combine. The first does tow things. It keeps IE users from using the enter key to submit a form and it disables the submit and reset buttons after a user has clicked submit. The second script confirms whether or not the user actually wishes to submit the form. The problem is that if the user decides they do not wish to submit the form, the submit button is still disabled. Can the two scripts be combined so that if they choose not to submit the form then the button is reactivated? Any help is greatly appreciated. Thank you.
<SCRIPT LANGUAGE="JavaScript">
<!--
function onKeyPress (){
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13){
return false
}
return true
}
document.onkeypress = onKeyPress;
function submitonce(theform){
if (document.all||document.ge
for (i=0;i<theform.length;i++)
var tempobj=theform.elements[i
if(tempobj.type.toLowerCas
tempobj.disabled=true
}
}
}
// -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function confirmSubmit()
{
var agree=confirm("Are you sure you wish to continue?");
if (agree)
return true;
else
return false;
}
// -->
</SCRIPT>
Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.
Posted on 2002-03-14 at 14:19:43ID: 28115891
All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.