Skip to main content

Posts

Submit

Submit: Every set of Form tags requires a Submit button. This is the element causes the browser to         send the names and values of the other elements to the CGI Application specified by the             ACTION attribute of the FORM element . <INPUT TYPE=“SUBMIT”> Submit has the following attributes: § TYPE: submit. § NAME : value used by the CGI script for processing. § VALUE: determines the text label on the button, usually Submit Query. Example on Submit Button <FORM     Action="URL"         method="get"> First Name: <INPUT TYPE="TEXT" Size=25 name=" firstName "><BR> Family Name: <INPUT TYPE="TEXT" Size=25 name=" LastName "><BR> <BR> <FONT Color=red> Press Here to submit the data:<BR> <INPUT TYPE="submit" VALUE=" Submit Data " > </FORM> Output ...

Push Button

Push Button: This element would be used with JavaScript to cause an action to take place . <INPUT TYPE=“BUTTON”> Push Button has the following attributes: § TYPE: button. § NAME: is the name of the button to be used                 in scripting. § VALUE: determines the text label on the button. Example on Push Button <DIV align=center><BR><BR> <FORM> <FONT Color=red> <h1>Press Here to see a baby crying:<BR> <INPUT TYPE="button" VALUE=" Press Me "><BR><BR> <FONT Color=blue> Click Here to see a baby shouting:<BR> <INPUT TYPE="button" VALUE=" Click Me " > <BR><BR> <FONT Color=green> Hit Here to see a baby eating:<BR> <INPUT TYPE="button" VALUE=" Hit ME " > <BR><BR> <FONT Color=yellow> </FORM></DIV> Output

Radio Button

Radio Button : Radio buttons allow the users to select only one option . <INPUT TYPE=“RADIO”> Radio buttons have the following attributes: § TYPE: radio. § CHECKED: is blank or CHECKED as the initial                         status. Only one radio button can be                          checked § NAME: is the name of the variable to be sent to the                  CGI application. § VALUE: usually has a set value. Example on Radio Button <HTML>  <HEAD> <TITLE> CheckBoxType </TITLE>  </HEAD> <BODY> <h1> <font color=green>Please check one of the following</font>...

Check Box

Check Box : Check boxes allow the users to select more than one option . <INPUT TYPE=“CHECKBOX”> Checkboxes have the following attributes: § TYPE: checkbox. § CHECKED: is blank or CHECKED as the initial                        status. § NAME : is the name of the variable to be sent to the                 CGI application. § VALUE: is usually set to a value. Example on Check Box <HTML>  <HEAD> <TITLE> CheckBoxType </TITLE>  </HEAD> <BODY> <h1> <font color=green>Please check one of the following</font></h1> <FORM name=" form3 "  Action=" url "  method="get"> <font color=red> Select Country: </font><BR> Sri Lanka:< INPUT TYPE=" CheckBox " Name="country"  CHECKED><BR> England<INPUT TYPE=" CheckBox "  ...

Password

Password : Used to allow entry of passwords. <INPUT TYPE= " PASSWORD " > Password boxes use the following attributes: § TYPE: password. § SIZE: determines the size of the textbox in characters. § MAXLENGHT: determines the maximum size of the password in characters. § NAME: is the name of the variable to be sent to the CGI application. § VALUE: is usually blank. Example on Password Box <HTML><HEAD> <TITLE> Form_Password_Type </TITLE></HEAD> <BODY> <h1> <font color=red>To Access, Please enter:</font></h1> <FORM name=" form2 "  Action=" url "  method="get"> User Name: <INPUT TYPE="TEXT" Name=" FName " SIZE="15" MAXLENGTH="25"><BR> Password: <INPUT TYPE="PASSWORD" NAME=" PWord "   value="" SIZE="15” MAXLENGTH="25"><BR> ...

Text Box

Text boxes : Used to provide input fields for text, phone numbers, dates, etc. <INPUT TYPE= " TEXT " > Browser will display Textboxes use the following attributes: § TYPE: text. § SIZE: determines the size of the textbox in characters. Default=20 characters. § MAXLENGHT : determines the maximum number of characters that the field will accept. § NAME: is the name of the variable to be sent to the CGI application. § VALUE: will display its contents as the default value. Example on Text Box  <HTML> <Head> <TITLE> Form_Text_Type </TITLE> </HEAD>  <BODY> <h1> <font color=blue > Please enter the following BioData </font></h1> <FORM name=" form1 "  Method= " get " Action= " URL " > First Name: <INPUT TYPE="TEXT" NAME=" FName " SIZE="15" MAXLENGTH="25"><BR> Last Name: <INPUT TY...

HTML Forms

§ To insert a form we use the <FORM></FORM> tags. The rest of the form elements must be inserted in between the form tags . <HTML>   < HEAD>   < TITLE> Sample Form</TITLE>   </ HEAD>   < BODY BGCOLOR=“FFFFFF”>   < FORM       ACTION = http:// www.xyz.com/formtest . php >   < P> First Name: <INPUT TYPE=“TEXT” NAME=“ fname ” MAXLENGTH=“50”> </P>   < P> <INPUT TYPE=“SUBMIT” NAME=“ fsubmit ” VALUE=“Send Info”> </P>   </ FORM >   </ BODY> </ HTML> <FORM> element attributes § ACTION : is the URL of the CGI (Common Gateway Interface) program that is going to accept the                     data from the form, process it, and send a response back to the browser. § METHOD : GET (default) or POST specifies which HTTP method ...