Comprog1 - SLK Q3 4
Comprog1 - SLK Q3 4
GRADE
11
Name: _______________________________________________________________________
After this lesson, you will be able to answer the following questions:
• What is name, id and value attribute?
• What are the other form elements?
• What is <label>, <textarea> and <select> element?
LESSON PROPER
In forms, name corresponds to the form element and identify what is posted back to the server
First Name:<br>
<input type="text" id=“fname" name=“name"><br>
Last Name:<br>
Page | 1
First Name:<br>
<input type="text" id=“fname" name=“name"><br>
Last Name:<br>
Page | 2
What is the purpose value attribute?
You can change the values of input type submit and reset to change the text inside the button.
<!DOCTYPE html>
<html>
<body>
<form action="send.php" method=”post”>
<h2> <label for=”fname”> Firstname: </label> </h2>
<input type="text" id="fname" name=“TVL"><br>
<br><br>
</form>
</body>
</html> Page | 3
The <textarea> Element
• The <textarea> element defines a multi-line input field (a text area)
• The rows attribute specifies the visible number of lines (number of rows) in a text area.
• The cols attribute specifies the visible width (number of columns) of a text area.
Page | 4
The <select> Element
• The <select> element defines a drop-down list.
• To add options inside the drop-down list box, use the <option> element.
• Add the value attribute in every <option> element as it will be the value when the option is
selected.
<select name=”strand”>
<option value=”abm”>ABM</option>
<option value=”tvl”>TVL</option>
<option value=”gas”>GAS</option>
<option value=”humss”>HUMSS</option>
</select>
REFERENCES:
https://www.w3schools.com/tags/tag_img.asp
https://w3schools.com/html/forms
Page | 5
ASSESMENT A
1. The user typed “DIAMOND” in the textbox, what would be the value of data that is
sent if the form is submitted?
A section=DIAMOND
B text= DIAMOND
C fname=DIAMOND
D submit=DIAMOND
2. The user typed “RIZAL” in the textbox, what would be the value of data that is sent if
the form is submitted?
Page | 6
A name= RIZAL
B text= RIZAL
C section= RIZAL
D submit=RIZAL
3. The user typed “PLARIDEL” in the textbox, what would be the value of data that is
sent if the form is submitted?
A section=PLARIDEL
B campus= PLARIDEL
C text=PLARIDEL
D branch=PLARIDEL
4. The user typed “SAN JOSE” in the textbox, what would be the value of data that is
sent if the form is submitted?
Page | 7
A campus= SAN JOSE
C branch=SAN JOSE
5. The user typed “MUZON” in the textbox, what would be the value of data that is sent
if the form is submitted?
A branch=MUZON
B text=MUZON
C campus=MUZON
D id=MUZON
Page | 8
ASSESMENT B
Build you own code based on the given task and situation.
EXAMPLE
• Create a webpage with input type text and password.
EXAMPLE ANSWER
<!DOCTYPE html>
<html>
<body>
<form method=”get”>
<input type=”text”>
<input type=”password”>
</form>
</body>
</html>
Page | 9
1
• Design a webpage with the following:
• 1 Textarea for comments with 40 rows and 25 columns
• Name your textarea as “comment”
• 1 reset button, change the text inside of the reset button to “Clear”
• 1 submit button, change the text inside of the submit button to “Send”
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
Page | 10
________________________________________________________________________________
2
• Design a webpage with the following:
• 1 drop-down list box (select element) for strand selection
with 5 options, ABM - TVL - GAS - HUMSS - STEM
• Name your Dropdown list box as “Strand”
• 1 reset button
• 1 submit button
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
Page | 11
________________________________________________________________________________
________________________________________________________________________________