Welcome To Snipplr
Everyone's Recent JavaScript Snippets Tagged form
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Permet de préremplir des champs avec le premier et le dernier jour du mois courant au format jj/mm/aaaa
0
1173
posted 10 years ago by Igeco
Removes $ from HTML form post, allows only number and decimal points. Has $ display in field but disappear when onfocus.
1
939
posted 11 years ago by lromak
JavaScript is the only option, if you want to have the ability to clear all form fields. Yes, HTML form has Reset method, but if the form has initial values, then Reset will return the form to the initial state instead of clear input fields. This exa...
1
934
posted 11 years ago by laxman2021
Allows you to click a given checkbox X, then shift click another checkbox Y. All checkboxes between X and Y will be checked or unchecked based on the state of checkbox Y. i.e. if you're unchecking Y all boxes between X and Y will also be unchecked.
1
1304
posted 12 years ago by ReedD19
Simply changes the name attribute on input elements when the page is loaded.
0
797
posted 12 years ago by stevielamb83
This send any value via POST to a PHP page. It is done with AJAX, so the POST return can be used on the same page as the submit
0
1135
posted 12 years ago by rickygri
This javascript function takes the URL of the target page and an associative array of name/values paires and POSTs the data to the supplied URL by dynamically creating a form and then submitting it.
0
2776
posted 12 years ago by rickygri
cross-browser way to select all text in a form element, via Jason on Stack Overflow
0
737
posted 12 years ago by charliefmoran
Usually when working with form you use a server to handle it, and if your doing it entirely in javascript no reload is required, but what if you wanted to take the information and use it in a javascript on another page, completely client side. I had...
0
1126
posted 12 years ago by FatFolderDesigner
Use this to convert JavaScript numbers to official scientific standard form (e.g. 1.54 × 10^3)
Uses HTML <sup> tags and × symbol
Example:
var number = 4.223e20;
var stnd = standardForm(number);
// stnd = 4.223 x 10^20
0
812
posted 13 years ago by Jellybean732
<p>usage: <br>
<code><a href="" onclick="recordOutboundLink(link, category, action, opt_label, opt_value);return false;"> <br>
<form id="uniqueID" onsubmit="trackFormSubmit(form, category, action, opt_label, opt_value);return false;"></...
0
1177
posted 13 years ago by freezy
JavaScript
Simple Math Captcha-like verification JavaScript script that uses jQuery (form) validation plugin
Don't forget to include jQuery validation plugin before this snippet. You can find it here:
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
0
1279
posted 13 years ago by racl101
Often you supply a default value in a text field which you want to automatically clear when the user enters the field. This will do that operation and fill the field with a default value.
0
817
posted 13 years ago by jimbo
Clear a field on entry if the default text matches a supplied value. Generic to any field.
0
728
posted 13 years ago by jimbo
Giorgio fecit.
Serve per controllare, a partire da un checkbox, che non ne siano selezionati altri nella stessa riga.
0
726
posted 14 years ago by tuffo19
Code matches querysting data to form feilds on the page based on the feild name.
I've added the example querystring to the body of the page.
Found at: http://codingforums.com/showthread.php?t=198419
Code by: Old Pedant
0
743
posted 14 years ago by Carolyne
We set up a voting page, where supporters would choose one of three candidates (only two are shown in the snippet). By clicking the checkbox, the supporter would add themselves to a Salsa group. This way only one vote for a candidate by a supporter w...
0
707
posted 14 years ago by powerthru
this is a way to deal with the fact that we can\'t reliably make checkboxes look larger on forms. So instead, we surround the form with a colored div, and set it up so that when the user clicks on the label next to the checkbox it checks the box.
0
803
posted 14 years ago by powerthru
In regards to progressive enhancement, see also the [jQuery version](http://snipplr.com/view/48275/default-value-for-input-fields-jquery-version/).
6
936
posted 14 years ago by riddla
I\'m constantly testing forms over and over for one reason or another, and am fed up with making a typo and autocomplete not populating all the data, so I made this little snippet. It searches for form elements on the page (input, textarea and select...
1
919
posted 14 years ago by dom111