Welcome To Snipplr


Everyone's Recent JavaScript Snippets Tagged form



1 370 posted 12 years ago by kopeo
I frequently pass an array of elements from an HTML form to PHP, normally a list of checkboxes for removing database records. This will loop through an array of checkbox's with the same name & build a delimited string from the checked values. Afte...
0 382 posted 12 years ago by verostudios
<input> When used instead of my SharePoint: SaveButton above, the form saved it's data correctly, and the current page that the form was submitted from was reloaded for the user. You could also put any URL in the __redirect={} that yo...
0 390 posted 12 years ago by rumremix
Fixes an issue if you have another login form on the page with a password field.
0 619 posted 12 years ago by linusx
Just thought id put up a version of my form validation class. It will be expanded in the future but I thought Id let everyone have a look. # Update 0.1 # * Create Error List Function * Validate Email Address Function * Valida...
0 543 posted 12 years ago by alvincrespo
Suppose you have a login form and you want to send the form when user press enter on his keyboard and not only by clicking on the submit button. This can be achieved capturing a specific event when the user is typing. We have to capture the keypress...
1 631 posted 12 years ago by ginoplusio
Amazing form validator using the jQuery framework!
1 433 posted 12 years ago by jaff
Usage: //any element window.onload = function(){ focusFirstInput(); } or // form elements under 'content-body' window.onload = function(){ focusFirstInput('content-body'); }
0 479 posted 13 years ago by neoprolog
JavaScritp Form Validation Framework to validate form fields on the fly, no programming knowledge required.
0 395 posted 13 years ago by clickfind
A very easy to use script for validating your forms.
2 463 posted 13 years ago by sarfraznawaz2005
Click on an input field with a prefilled value, if that value equals the default then select it, if not leave it as it was. Relies on jQuery.
2 809 posted 13 years ago by 1man
I came across this little snippet... and thought it was rather nice.
0 409 posted 13 years ago by gembry
Use by inserting the following in the head. <script> $(document).ready(function() { $("input").toggleVal(); }); </script>
0 634 posted 14 years ago by davebowker
this requires jquery.js, jquery.metadata.js, and jquery.validate,js
2 469 posted 14 years ago by bcalloway
Para validar si son dígitos, letras, números enteros o decimales (se puede seleccionar el separador de decimales). La función esDigito() y esLetra() está basada en otros códigos de Snipplr
1 362 posted 14 years ago by sulfurito
Requires Mootools 1.2<br/> http://mootools.net/download Based on the mootools javascript framework a re-usable class for easily implementing an array of on submit events. * Confirmation - Provides an Ok, Cancel input box before proceeding furt...
1 419 posted 14 years ago by dom111
When there's a value in a textbox, like 'search', it disappears when you click on it, and reappears when you leave (blur) it. But only if you haven't filled in anything ofcourse. Use it like this:
1 327 posted 14 years ago by jeppeb
Name the form what ever you like, but make sure that is reflected in the javascript.
0 3394 posted 14 years ago by jachin
0 421 posted 14 years ago by wfdev
Para realizar validaciones en Javascript rápidamente. Requiere que en la etiqueta metamos un onSubmit="return checkform(this);" . Este trozo de código es para dos campos input con nombres campo1 y campo2.
0 267 posted 14 years ago by betacontinua
using bgiframe to solve a bug in explorer: you cannot apply z-index to place divs over selects in a form!!!
1 544 posted 15 years ago by victorchamorro
For forms with a default value onload you don't want your users to have to select the value, delete it and then insert their own input. This function focuses on a selected input, then it selects the default text so the user can easily type their o...
1 522 posted 15 years ago by 1man
Copy values from the first row of a column down the entire column. This was used in a specific project, but the code could be helpful for other projects.
1 361 posted 15 years ago by davaodude