Form Allows You To Gather Feedback From Your Readers or Visitors and Work On The Data To Provide Better Service
Form Allows You To Gather Feedback From Your Readers or Visitors and Work On The Data To Provide Better Service
Form allows you to gather feedback from your readers or visitors and
work on the data to provide better service.
Fields, text fields or text boxes – are the areas on the form.
Standard controls such as ( check buttons, radio buttons and list boxes.
Two attributes of form
• Action attribute is responsible for indicating where the information will be passed whether it is to
another web page or to a script.
• Method attribute –is responsible for indicating the way for sending the information.
Textboxes are single line text input boxes. Usually, textboxes are used
for username input and other single line texts such as names, email
addresses, etc. and can be made by keying in text as the value of the
type attribute of <input>.
* Additionally, you can use the value attribute to set an initial text
input. The size attribute then indicates the length of the textbox.
Sample of text box
<html>
<head><title>Computer Books, Software, Hardware</title></head>
<body>
<form
action=http:www.myserver.com/myscript.cgi method=“post”.
<h3>Customer Survey Form</h3>
<hr align=“left”/>
<h5>Name<input type=“text”/></font></p></h5>
</form>
</html>
Creating a Large Text Area
• You can create an input field that can span several rows, and columns
to allow the readers to enter their feedback request, instructions,
opinions or any communication.
• Text areas are made via the container tag ,<textarea></textarea>.
The content of this tag will be displayed in the text area by default.
Ex: <textarea name=“textarea1”>This is a text area.</textarea>
Sample Text area code
<html>
<head><title>Computer Books, Software, Hardware</title></head>
<body>
<form
action=http:www.myserver.com/myscript.cgi method=“post”.
<h3>Customer Survey Form</h3>
<hr align=“left”/>
<h5>Name<input type=“text”/></font></p></h5>
<p>To help us better serve you, please write your comments<br>
<textarea name=“feedback” rows=“15” cols=40”>
</textarea>
</form>
</body>
</html>
Soft word wrapping wraps the text only in the text area and not when it is
submitted. Can be made by keying in soft as the value for the wrap attribute and
hard if it is hard word attribute. Word wrapping can be removed by keying in off as
the values for the wrapping attribute.
Attributes for
<textarea></textarea>
Attribute Name Definition Values
name Assigns a name to the text area. Any text (without spaces)
The name can be used for various
purposes and is required in most
circumstances.
Ex: <textarea
name=“textarea1”>This is a text
area.</textarea>
rows Indicates the number of rows or Any number
the height of the text area.
Ex: <textarea name=“textarea1”
rows=“10”>This is a text
area.</textarea>
cols Indicates the number of columns Any number
or width of the text area.
Ex: <textarea name=“textarea1”
cols=“10”>This is a text
area.</textarea>
wrap Indicates the type of word Soft, hard, off
wrapping in the text area.
Ex: <textarea name=“textarea1”
wrap=“off”>This is a text
area.</textarea>
Creating Radio Buttons
Radio buttons provide the users a variety of choices where only one
can be selected. Radio buttons can be made by keying in radio as the
value of the type attribute of <input>.
* Bear in mind that in a set radio buttons, only one can be chosen; the
name attribute is also used to indicate which set that radio button
belongs. Radio buttons of the same group have similar values for their
name attribute.
The checked attribute is applicable for radio buttons to indicate a
default selected option. Radio buttons are usually used when the
choices are only few.
<html>
<head><title>Computer Books, Software, Hardware</title></head>
<body>
<form
action=”http:www.myserver.com/myscript.cgi” method=”post”
<h3>Customer Information Form</h3>
<hr align=”left”/>
<p>Please check the products you have used in the past 2 years<br><br>
<input name=”pictype” type=”radio” value=”cross”>
Adobe Photoshop</font></p>
<input name=”pictype” type=”radio” value=”cross”>
Microsoft Excel</font></p>
<input name=”pictype” type=”radio” value=”cross”>
Norton AntiVirus</font></p>
</form>
</body>
</html>
Creating Check Boxes
Check boxes offer users a variety of choices where none, only one or
many may be selected. Check boxes can be made by keying checkbox
as the value of the type attribute of <input>.
Example: <input type=“checkbox” name=“checkboxCS”>
</form>
</body>
</html>
Creating an Email Feedback Form
Feedback Form allows communication with your web sites visitors.
Visitors can submit questions and comments which will then be
forwarded to your email address.
The value of the value attribute indicates the label on the button
<html>
<head><title>Computer Books, Software, Hardware</title></head>
<body>
<caption>IT LEARNING</caption>
<hr width=”25%” align=”left”/>
<form
action=”http:www.myserver.com/myscript.cgi” method=”post”
<h3>Customer Information Form</h3>
<p>Please choose the month when you are available for IT classes
<select name=”contractchoice” size=”2”>
<option>January</option>
<option>February</option>
<option>March</option>
</select></font></p>
Click the Submit button to send us your completed form.
<p><input type=”submit” value=”Submit”>
<input type=”reset” value=”Reset”>
</form>
</body>
</html>
Adding a Reset Button
Rese or Clear Button is usually placed at the end of a form. When it is
clicked it clears all the input information. This can be done by keying in
reset as the value of the type attribute of <input>.
Example:<input type=“reset”>
Likewise, the value of the value attribute indicates the label on the
button.