Welcome To Snipplr


Everyone's Recent Snippets Tagged forms



0 1161 posted 15 years ago by landonmiller
0 3312 posted 15 years ago by martin_rusev
display: block; needed for IE7 to enable the negative text-indent.
2 1884 posted 15 years ago by adambundy
This is inspired by this http://www.cgi101.com/book/ch5/text.html so I'm using a similar example. In PHP you can combine a set of checkboxes into an array using square brackets like this: <form> <input> Red<br> <input> Green<br>...
1 1909 posted 16 years ago by ptepper
Variables that are submitted via web forms always need to be cleaned/sanitized before use in any way, to prevent against all kinds of different malicious intent.
0 1099 posted 16 years ago by paulgrenwood
1 1493 posted 16 years ago by paulgrenwood
E-mail validation is perhaps the most used validation in web forms, this code will validate email address and also optionally check the MX records of the domain provided in email address to make email validation more robust.
2 1583 posted 16 years ago by paulgrenwood
IE adds a vertical scrollbar to textarea input fields regardless of the height of content in it. You can fix that with this simple CSS trick.
2 1624 posted 16 years ago by paulgrenwood
This CSS trick lets you highlight the input field currently in focus. This trick does not work in IE though.
0 1055 posted 16 years ago by paulgrenwood
3 1500 posted 16 years ago by mauricenaef
Usage: //any element window.onload = function(){ focusFirstInput(); } or // form elements under 'content-body' window.onload = function(){ focusFirstInput('content-body'); }
0 1311 posted 16 years ago by neoprolog
1 1169 posted 16 years ago by jonniespratley
Sometimes you can't use an image button, you have to use a submit button, but you still want to hide the text and show an image instead. The width and height can be changed, of course. The point is that they are specified. Display:block is need...
1 2367 posted 16 years ago by jessibird
This is one of my favs to use and reuse. Essentially, we make a select box on what is in the table filled values/labels. Download the ISO countries list to make a country table and Bam! with this function you got a country select box... Also grea...
1 1090 posted 16 years ago by brownrl
1 1477 posted 16 years ago by jseltzer
Quick little function to give you a select box for numbers ranging from min to max. Perfect for birthday date selectors.
0 1076 posted 16 years ago by brownrl
Works in IE not Firefox/Mozilla.
0 1295 posted 16 years ago by hotdiggity
1 1299 posted 16 years ago by hotdiggity
0 1129 posted 16 years ago by josephfritz
Converts a standard select box to a clickable image thumbnail list. <code> &lt;select&gt; &lt;option&gt;/images/test1.jpg&lt;/option&gt; &lt;option&gt;/images/test2.jpg&lt;/option&gt; &lt;/select&gt; &lt;script&gt; $('#image').imageSelect();...
1 1321 posted 16 years ago by ping_ch
2 1808 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 1380 posted 16 years ago by kcmr
Always always always backup client side validation with server side validation! =D
2 1698 posted 16 years ago by charmcitycoder
Simple enough.
3 1716 posted 17 years ago by mattkenefick
If you add a ContextMenuStrip (the menu that shows up when you right-click on something) to your design, you can conveniently have more than one form control use that context menu. The only problem is that you don't know which control the context men...
0 3392 posted 17 years ago by pckujawa
I'm working on a web app that requires me to track nearly 300 form fields. To make this easier, and to allow me to handle special cases, I needed to assign them to an internal array. The switch/case statement makes this a breeze.
1 1222 posted 17 years ago by mdrisser