Welcome To Snipplr


Everyone's Recent JavaScript Snippets Tagged forms



1 2 Next »
Controllo sui caratteri nelle textboxes in Javascripts
0 752 posted 13 years ago by tuffo19
This is a simple and effective way yo make sure people are actually filing out a form before submitting it. If you need to verify content it should be done server side (so that if you come across the odd person with javascript turned off it wont brea...
0 1006 posted 14 years ago by FatFolderDesigner
I was working on this for a new site ideal I have, though it might be useful for others. What this does it sent a AJAX POST request every time the as() function is called. Setting the form to run as() onkeyup will essentially make the form submit its...
1 1043 posted 14 years ago by FatFolderDesigner
In regards to progressive enhancement, see also the [jQuery version](http://snipplr.com/view/48275/default-value-for-input-fields-jquery-version/).
6 1061 posted 14 years ago by riddla
different solution by PPK:\\r\\n[http://www.quirksmode.org/book/examplescripts/maxlength/index.html](http://www.quirksmode.org/book/examplescripts/maxlength/index.html)
0 847 posted 14 years ago by cfleschhut
Replace “value” with the default value. If the field is selected, the default value will go away. If the user has previously changed the field value, it’ll be left alone. Alternatively, use onfocus=”this.value=”;” to always clear the f...
1 950 posted 14 years ago by iqwebdev
0 774 posted 14 years ago by iqwebdev
adopted from: http://www.alistapart.com/articles/makingcompactformsmoreaccessible/
0 926 posted 15 years ago by cfleschhut
Usage: //any element window.onload = function(){ focusFirstInput(); } or // form elements under 'content-body' window.onload = function(){ focusFirstInput('content-body'); }
0 911 posted 15 years ago by neoprolog
Works in IE not Firefox/Mozilla.
0 940 posted 15 years ago by hotdiggity
2 1316 posted 16 years ago by shahways
Función para usar con el evento onkeydown, que funciona igual en todos los navegadores. Onkeypress devuelve 0 para las teclas especiales en navegadores que no sean Internet Explorer.
0 981 posted 16 years ago by kcmr
Always always always backup client side validation with server side validation! =D
2 1158 posted 16 years ago by charmcitycoder
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 860 posted 16 years ago by dom111
I wrote this very quickly for a form I parse that allows a user to send a page to up to 5 friends. The script adds a click event to an image of a + sign beside an input box. When clicked if the user hasn't already added 5 friends to email, additional...
9 1259 posted 16 years ago by dmosher
0 1079 posted 17 years ago by Victoor
1 885 posted 17 years ago by m00min
replace submit buttons with nice images and does also the rollover. Easy.
1 919 posted 17 years ago by valcartei
when testing forms you don't always want to fill in dummydate this is a function i used to autofill and select values.
1 854 posted 18 years ago by assbach
Used to change the color of a text box.
2 1041 posted 18 years ago by kathyd
1 2 Next »