Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged forms



« Prev 1 Next »
Populate Fields from Post Data Add this to functions.php
0 1296 posted 12 years ago by paddy1228
dynamically selects a value in a select according to what's already in the DB
0 1151 posted 13 years ago by dato
0 1143 posted 14 years ago by etechblog
Simple simple simple function to make a checkbox for a form. Retains checked status.
0 1144 posted 14 years ago by brownrl
Come rendere uppercase un textbox senza bisogno di js
0 2360 posted 14 years ago by tuffo19
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 2303 posted 14 years ago by bradless
Feel free to use this class however you'd like
0 1452 posted 14 years ago by jschilling
0 1265 posted 14 years ago by kidmizere
0 1140 posted 15 years ago by picxelplay
For instance when you want to leverage the JElements in a admin view form...
0 1356 posted 15 years ago by harikaram
processes contact form input and produces an auto reply
0 1127 posted 15 years ago by sandman7OR
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 1781 posted 15 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 1604 posted 15 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 1134 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 1642 posted 16 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 1146 posted 16 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 1110 posted 16 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 1275 posted 17 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 1235 posted 17 years ago by LoRd1990
1 1566 posted 18 years ago by eethann
a function to check the validity of the postcode according to UK rules
0 3970 posted 18 years ago by valcartei
« Prev 1 Next »