Welcome To Snipplr
Everyone's Recent Snippets Tagged form
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
run as callback from form_validation->setrules
ex:
$this->form_validation->set_rules('cc_number','Credit Card #','required|max_length[20]|callback_alpha_dash_space');
0
783
posted 14 years ago by myke
On Zend Framework you can add options on Select Element on Form.php or Controller Action, and after you can disable it, on Form.php or Controller.php too.
1
1197
posted 14 years ago by postNuKe
This worked on the limo site. I need to change the form action for it to work with another project.
0
744
posted 14 years ago by gera3d
There are a lot of snippets if you want countries in a select box (dropdown). I wanted them as check boxes organized by Continent. In my implementation (not represented in this code). I added ajax toggles so that each Continent's countries were hidde...
0
1888
posted 14 years ago by maestrojed
I frequently pass an array of elements from an HTML form to PHP, normally a list of checkboxes for removing database records. This will loop through an array of checkbox's with the same name & build a delimited string from the checked values. Afte...
0
700
posted 14 years ago by verostudios
This function returns True if the specified form is open in form view or datasheet view.
0
689
posted 14 years ago by CaptainProton
After i saw this snippet http://snipplr.com/view/33790/form-country-code-select-with-if-selected-test/ i wanted to make the code better :D
To make it easier to maintain
0
935
posted 14 years ago by cigraphics
<input>
When used instead of my SharePoint: SaveButton above, the form saved it's data correctly, and the current page that the form was submitted from was reloaded for the user.
You could also put any URL in the __redirect={} that yo...
0
697
posted 14 years ago by rumremix
Fixes an issue if you have another login form on the page with a password field.
0
1052
posted 14 years ago by linusx
Frequently I like to make data more user friendly, so while I make it easy for them to add a date as a shorthand format (mm/dd/yyyy) I like to return it as something easier to digest (Day of Month in Year, etc). This is the simplest way to do that I'...
0
799
posted 14 years ago by xekonic
jQuery plugin that let you specify a maximum length on a text field and optionaly specify the change the focus when that maximum length has been reach. Nice when making multiple input text to create a telephone form.
Example: $("#telephone_1").maxLe...
0
655
posted 14 years ago by frankyfish
Resizing fields using a custom module
You could also resize the field using a custom module.
For example, if you created mysite.module, you could use something like this to reduce the field size to 30 characters
4
1008
posted 14 years ago by marcelodornelas
original source - http://www.filamentgroup.com/lab/update_styling_the_button_element_with_css_sliding_doors_now_with_image_spr/
Overides default styling
0
679
posted 14 years ago by tennison
NOTE: THIS HAS BEEN MOVED TO GITHUB:
If you have any ideas or improvements for this script feel free to fork or contribute or discuss over there:
https://github.com/adamcoulombe/jquery.customSelect
Plugin Download: http://www.adamcoulombe.info...
2
1576
posted 14 years ago by adamcoulombe
1. Use absolute positioning to place label over the text box
2. Hide label except when JS is enabled
3. Use jQuery to hide label when field receives focus
1
681
posted 14 years ago by flicity
Just thought id put up a version of my form validation class. It will be expanded in the future but I thought Id let everyone have a look.
# Update 0.1 #
* Create Error List Function
* Validate Email Address Function
* Valida...
0
961
posted 14 years ago by alvincrespo