Submit Once- Form Validation Javascript Rumi, July 23, 2008 If you have forms on your site, you know they are extremely prone to abuse by users. Apart from incomplete or bogus entries, the most common offense is duplicate submissions by the same individual, caused by pressing the “Submit” button over and over and over again. Well, this DHTML script has a cure for the problem, by allowing you to disable the submit (and reset) button once it is pressed once. Note that the disabling effect is applied only to IE 4+ and NS 6+ browsers. All other browsers will still be able to sneak by and submit the form (degrades well). Also, the disabled buttons can easily be resurrected by reloading the page. Step1: Insert the below validation code into the <head> of your page: <script> /* Submit Once form validation- © Dynamic Drive (www.dynamicdrive.com) For full source code, usage terms, and 100’s more DHTML scripts, visit http://dynamicdrive.com */ function submitonce(theform){ //if IE 4+ or NS 6+ if (document.all||document.getElementById){ //screen thru every element in the form, and hunt down “submit” and “reset” for (i=0;i<theform.length;i++){ var tempobj=theform.elements[i] if(tempobj.type.toLowerCase()==”submit”||tempobj.type.toLowerCase()==”reset”) //disable em tempobj.disabled=true } } } </script> Step-2 Inside the form in question, add the part in red to the <FORM> tag, as follows: <form method=”POST” onSubmit=”submitonce(this)”> Related Scripts
How do I line up 3 divs on the same row July 24, 2013 Part one- <div> <h2 align="center">San Andreas: Multiplayer</h2> <div align="center" class="float-left">CONTENT OF COLUMN ONE GOES HERE</div> <div align="center" class="float-left">CONTENT OF COLUMN TWO GOES HERE</div> <div align="center" class="float-left">CONTENT OF COLUMN THREE GOES HERE</div> </div> And inside CSS file- .float-left { float:left; width:300px; // or 33% for equal width independent of parent width… Read More
Zimbra Let’s Encrypt auto-renew SSL January 26, 2023 Required for this script to work is certbot package installed on email server and sudo rights to add script in crontab. You can add script in crontab at a weekly run like this: 0 0 * * 0 root /path_to_script. #!/bin/bash #Set domain for renew (in format openthreat.ro) DOMAIN=”” certbot… Read More
WordPress Backup Script August 23, 2020 #!/bin/bash # This script creates a compressed backup archive of the given directory and the given MySQL table. More details on implementation here: https://theme.fm # Feel free to use this script wherever you want, however you want. We produce open source, GPLv2 licensed stuff. # Author: Konstantin Kovshenin exclusively for… Read More