17 Form Buttons

Back to Web Design

Assignment #25 & #26

Creating Form Buttons 

Submit Button – sends the information to the server and runs the CGI script

<INPUT TYPE=SUBMIT VALUE=”text”>

VALUE defines the text that appears on the button

Cancel or Reset button

<INPUT TYPE=RESET>  

To perform an action within the Web page by running a program or script

<INPUT TYPE=BUTTON VALUE=”text”>

(you will learn how to write programs to go with the button in a later lesson)                                               

Image Fields – to use images instead of buttons 

<INPUT TYPE=IMAGE SRC=”URL” NAME=text VALUE=”text”>

            URL is the filename or URL of the inline image 

Hidden Fields – used to hide information needed by the CGI script server from the users 

<INPUT TYPE=HIDDEN NAME=text VALUE=value> 

Example: <INPUT TYPE=HIDDEN NAME=EMAIL VALUE=”byers@yvhs.net”> 

Form Properties 

Action                         identifies the CGI script will process your form

                                    <FORM ACTION=URL>

                                    URL is the URL of the CGI script (given to you by your service provider) 

Method                       controls how your Web browser sends data to the Web server running the CGI script

                                    <FORM METHOD=Type>

                                    Type is either GET or POST(preferred) 

Encrypt                       specifies the format of the data when it is transferred from your Web page to the CGI script

                                    <FORM ENCTYPE=Text>

                                    Text is the data format (“application/x-www-form-urlencoded”) or (“multipart/form-data”) 

Target                         to specify which frame receives output from the CGI script (only needed when page has frames) 

MAILTO Action – uses the users e-mail program to process and send the script 

<FORM ACTION=”mailto:e-mail_address” METHOD=POST>

e-mail_address is the address where the form is to go