Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged forms
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
« Prev 1 Next »
dynamically selects a value in a select according to what's already in the DB
0
668
posted 12 years ago by dato
Simple simple simple function to make a checkbox for a form. Retains checked status.
0
701
posted 13 years ago by brownrl
I use the following code to prevent a user from getting a "webpage expired" message when hitting the back button on a page where the search results are also on the page with the form.
0
875
posted 13 years ago by bradless
For instance when you want to leverage the JElements in a admin view form...
0
831
posted 14 years ago by harikaram
A handy, generic form processor which validates presence of fields marked in a hidden value, like: <input>. Easy to override and customize as needed.
Adapted from a script found in PHP 5 Unleashed.
1
1018
posted 14 years ago by nate63179
By using hook_form_alter, you can add your own callback functions to any Drupal form.
These functions will be called when Drupal validates the form and when Drupal submits it.
In example below, a module called 'simple_checkout' adds its own hand...
1
802
posted 14 years ago by berkes
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
700
posted 15 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
924
posted 15 years ago by paulgrenwood
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
696
posted 15 years ago by brownrl
Quick little function to give you a select box for numbers ranging from min to max. Perfect for birthday date selectors.
0
688
posted 15 years ago by brownrl
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
766
posted 16 years ago by mdrisser
If you had seen some errors in the code, please send me notice about it on the: [email protected]
Thanks, K.Karpenko
1
792
posted 16 years ago by LoRd1990
a function to check the validity of the postcode according to UK rules
0
3198
posted 17 years ago by valcartei
« Prev 1 Next »