| home / programming / javascript / hform / 1 | [previous] |
|
|
Some more common controls or children elements for a form are as follows.
button : a developer may create 3 types of buttons:
|
name=on
The checkbox controls are created using the input element and by setting type="checkbox"
file : This control is used to upload files to the form processing application with the form submission. You will have to make sure that you use method="post" and enctype="multipart/form-data" whenever you're uploading files. The file control is created using input element and setting the type="file"
hidden controls : These are controls that are not visible by a client user, but their content may be sent to the form processing applications when a form is submitted. Be aware that hidden controls and all other controls (set to be hidden using style sheets) may be passed onto the form processing application. The hidden controls are created using the input element and setting the type="hidden"
menu : Menu controls are set using the select element in combination with option elements. The HTML standards require that a select element must contain least one option element.
object : Object controls are used to embed music, video or flash movies in an HTML document.
radio : Are on/off switches. Radio buttons are created in a set/group
of radio buttons. i.e. A group of radio buttons may share same value for name
attribute, and only the button that is on will be passed on to the form processing
applications. A developer should set at least one radio button in a group
to "on" The radio controls are created using input element and setting the
type="radio"
text : There are two types of input controls:
1. One is created using input element and setting the type="text"
2. A textarea element
The only difference between the two is that the first creates a single line input area whereas the latter creates a multiple lines input area.
Finally, make sure that you set the return type of your JS function to true or false depending upon the logic you've used. This will make sure that when JavaScript is enabled, a form does is not submitted when it's not required.
Khalid Ali is a Freelance Developer who works out of Calgary, Alberta, in Canada. Over several years, he has participated in projects involving various programming languages, including VB, C/C++ and Java. His web related experience includes projects using Java servlets/jsp XML/XSL and Javascript/DHTML/XSS/HTML. Khalid can be reached at via email k_ali@shaw.ca
| home / programming / javascript / hform / 1 | [previous] |
Created: June 2, 2003
Revised: October 16, 2003
URL: http://webreference.com/programming/javascript/hform