Navigation Home / Tags / Form

ranking Sort Sort   |   date Sort Sort   |   member Sort Sort

Date Submitted Fri. Oct. 11th, 2013 11:01 AM
Revision 1
Beginner codeprince51
Tags browser | default | Form | windows
Comments 0 comments
Easily opens the provided link in default browser.
Date Submitted Sat. Aug. 24th, 2013 5:32 AM
Revision 1
Beginner annehr75
Tags Form | redirect
Comments 0 comments
If you have a form which ob being filled, you would like the user to be redirected to another page.
In these cases if you try to post to $_SERVER['PHP_SELF'], this will not work.

The only way to handle this is to use the header() function if no other text/string data has been output by the web server to the users browser.

You'll need to put the logic for the redirect at the top of your script before anything else(Replace your redirection URL in place of

The reason for this is that when a browser receives information from the web server it receives an HTTP header (which the header() function outputs the redirect to), and then outputs the body of the HTTP response after the HTTP header. If your script is echoing anything before the header command, you'll continue to receive error saying that the header information cannot be modified.
Date Submitted Fri. Dec. 14th, 2007 4:41 PM
Revision 1
Scripter Fordiman
Tags "javascript" | Form | Prototype
Comments 0 comments
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.
Date Submitted Fri. Jul. 20th, 2007 8:07 PM
Revision 1
Scripter ColdKeyboard
Tags ajax | Form | Sumbit
Comments 1 comments
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.
Date Submitted Tue. Apr. 10th, 2007 9:39 PM
Revision 1
Helper snowdonkey
Tags Form | PHP | Validate
Comments 3 comments
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.
Date Submitted Sun. Sep. 24th, 2006 5:35 PM
Revision 1
Helper kahotep
Tags Form | HTML | PHP
Comments 3 comments
Generates a tree view within a dropdown select box.
Date Submitted Fri. Jul. 28th, 2006 1:10 AM
Revision 1
Beginner delook
Tags Form | HTML | JavaScript
Comments 2 comments
Set a word or phrase in an input field, clear it onfocus
Date Submitted Mon. May. 1st, 2006 8:26 AM
Revision 1
Coder mattrmiller
Tags Focus | Form | JavaScript | Password | Username
Comments 0 comments
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.
Date Submitted Wed. Nov. 9th, 2005 11:45 PM
Revision 1
Helper poncho
Tags Form | JavaScript | Zero
Comments 0 comments