Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged forms



« Prev 1 Next »
Populate Fields from Post Data Add this to functions.php
0 1758 posted 13 years ago by paddy1228
dynamically selects a value in a select according to what's already in the DB
0 1652 posted 14 years ago by dato
0 1570 posted 14 years ago by etechblog
Simple simple simple function to make a checkbox for a form. Retains checked status.
0 1544 posted 15 years ago by brownrl
Come rendere uppercase un textbox senza bisogno di js
0 2850 posted 15 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 2798 posted 15 years ago by bradless
Feel free to use this class however you'd like
0 1971 posted 15 years ago by jschilling
0 1797 posted 15 years ago by kidmizere
0 1586 posted 15 years ago by picxelplay
For instance when you want to leverage the JElements in a admin view form...
0 1831 posted 15 years ago by harikaram
processes contact form input and produces an auto reply
0 1560 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 2308 posted 16 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 2121 posted 16 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 1614 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 2171 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 1606 posted 17 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 1589 posted 17 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 1756 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 1772 posted 18 years ago by LoRd1990
1 2136 posted 18 years ago by eethann
a function to check the validity of the postcode according to UK rules
0 4839 posted 19 years ago by valcartei
« Prev 1 Next »