JavaScript Source Code 3000: Forms: Disable Submit
Disable Submit
(Internet Explorer only) When the form is submitted, any submit and reset buttons are disabled. This prevents the user from submitting the form repeatedly, whether by accident or on purpose. The form will just act normally for Netscape users. Great!
Name:
JavaScript Source Code 3000: Forms: Disable Submit
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!
<!-- TWO STEPS TO INSTALL DISABLE SUBMIT:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Web Site: http://dynamicdrive.com -->
<! >
<! >
<!-- Begin
function disableForm(theform) {
if (document.all || document.getElementById) {
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements[i];
if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
tempobj.disabled = true;
}
setTimeout('alert("Your form has been submitted. Notice how the submit and reset buttons were disabled upon submission.")', 2000);
return true;
}
else {
alert("The form has been submitted. But, since you're not using IE 4+ or NS 6, the submit button was not disabled on form submission.");
return false;
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form onSubmit="return disableForm(this);">
Name: <input type=text name=person>
<input type=submit><input type=reset>
</form>
</center>
<!-- Script Size: 1.33 KB -->
Wyszukiwarka
Podobne podstrony:
submittedDisabling the wp crondisabledsubmiterrorshowPdf submitPDF=Full Text PDF (102 KB)&doi=10 1034 j 1600 082X 2000 d01 7submitresume v2 g7kjr5omxh6ar4sklifkwxjreng4yseezqsijyaoption theme?vanced disableDisable Schedule Task in IEusers disabledsubmiterrorSubmitResume v2 (2)submit linkSUBMITTINGsubmittedsubmiterrorwięcej podobnych podstron