4
AJAX based submit form and use PHP to get results...
Very easy to use and understand, hope you will find it useful and easily edit it to fit your needs.
Very easy to use and understand, hope you will find it useful and easily edit it to fit your needs.
14
Set a word or phrase in an input field, clear it onfocus
2
Prototype's Form.Methods library has a nice piece of code called 'serialize', which, if passed with the optional 'hash' parameter set to true, will convert an HTML form into a Javascript Object.
I was dismayed, however, to find that there was no way to reverse it; just as simply load a form using a Javascrip object.
So, here's one. enjoy.
I was dismayed, however, to find that there was no way to reverse it; just as simply load a form using a Javascrip object.
So, here's one. enjoy.
15
Generates a tree view within a dropdown select box.
10
mattrmiller
This is a correct way to do login form auto-focus, checking to see if either username or password have focus already. This prevents someone from typing a username hitting TAB, then having JavaScript chime in, resetting focus to Username while user is typing in their password. In this case, the password is appended to the username which is in plaintext.
2
The following script is a single interface for pre-validating any HTML form. It lets you validate your form data the way you want, while handling the rudimentary tasks itself.
1) Change just one variable to make it work with $_GET or $_POST or $_REQUEST.
2) Name which elements are 'required' all at once in a hidden HTML text input.
3) Easily provide field descriptions in hidden HTML text inputs that you can use to print error statements.
4) Call a single function to print out error statements that you can easily style with CSS.
5) It automatically checks if fields marked 'required' have been filled out.
Most of the pre-validation code is from PHP 5: Unleashed by Sams Publishing. I found it extremely useful for a recent project. Sharing it here, I removed some unnecessary functions, and tried to simplify some points.
All the comments are my own; hopefully I provided more than enough explanation.
1) Change just one variable to make it work with $_GET or $_POST or $_REQUEST.
2) Name which elements are 'required' all at once in a hidden HTML text input.
3) Easily provide field descriptions in hidden HTML text inputs that you can use to print error statements.
4) Call a single function to print out error statements that you can easily style with CSS.
5) It automatically checks if fields marked 'required' have been filled out.
Most of the pre-validation code is from PHP 5: Unleashed by Sams Publishing. I found it extremely useful for a recent project. Sharing it here, I removed some unnecessary functions, and tried to simplify some points.
All the comments are my own; hopefully I provided more than enough explanation.









