Welcome To Snipplr


Everyone's Recent JavaScript Snippets Tagged forms



1 2 Next »
Controllo sui caratteri nelle textboxes in Javascripts
0 1528 posted 15 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 2043 posted 15 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 2222 posted 15 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 2459 posted 15 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 1743 posted 16 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 2038 posted 16 years ago by iqwebdev
0 1633 posted 16 years ago by iqwebdev
adopted from: http://www.alistapart.com/articles/makingcompactformsmoreaccessible/
0 1804 posted 16 years ago by cfleschhut
Usage: //any element window.onload = function(){ focusFirstInput(); } or // form elements under 'content-body' window.onload = function(){ focusFirstInput('content-body'); }
0 1867 posted 17 years ago by neoprolog
Works in IE not Firefox/Mozilla.
0 1913 posted 17 years ago by hotdiggity
2 2521 posted 17 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 1958 posted 17 years ago by kcmr
Always always always backup client side validation with server side validation! =D
2 2330 posted 17 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 1758 posted 18 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 2408 posted 18 years ago by dmosher
0 1964 posted 18 years ago by Victoor
1 1790 posted 18 years ago by m00min
replace submit buttons with nice images and does also the rollover. Easy.
1 1759 posted 19 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 1823 posted 19 years ago by assbach
Used to change the color of a text box.
2 2432 posted 20 years ago by kathyd
1 2 Next »