Web Technology Questions and Answers – Forms

This set of Web Technology Multiple Choice Questions & Answers (MCQs) focuses on “Forms”.

1. What are Forms in web programming?
a) They are used to create Table data and its information
b) They allow you to enter data which can be processed to servers
c) They are matrices on web page
d) They are the information filled by the server-side
View Answer

Answer: b
Explanation: Forms can look a lot like papers or database forms. A form is filled using text boxes, chechboxes, radiobuttons. For example, applying/order a product from online or it’s a google search result.

2. How does a browser send data to the server regarding forms?
a) name/value pairs
b) key/id pairs
c) Just names as data
d) Values as data
View Answer

Answer: a
Explanation: When a browser sends data to the server, it is transmitted in name/value pairs. The name corresponds to the name of the form control, and the value is what the user has entered (if the user can type an answer) or the value of the option selected (if there is a list of options to choose from).

3. Which of the following is not a control of Form on a webpage?
a) A text input
b) Submit buttons
c) Checkboxes
d) XML format
View Answer

Answer: d
Explanation: A text input, which is where you enter your search term. Submit buttons, which are used to send the form to the server. Checkboxes ae used to select one or more options according to the user.
advertisement
advertisement

4. What is the action attribute in form element?
a) It contains the value of the URL of a page on the web server
b) It contains the series of actions which the webpage must go through
c) It tells the action needed by the webpage to continue without any interruption
d) It shows the failed/interrupted action on a webpage by a third party
View Answer

Answer: a
Explanation: The <form> element carries an attribute called action whose value is the URL of the page on the web server that handles search requests. Meanwhile, the method attribute indicates which of two HTTP methods will be used in getting the form data to the server.

5. What is the relation between whitespace and <form> element?
a) When a browser comes across a <form> element it often creates extra white space around that element
b) <form> element has nothing to do with the whitespace
c) To create a whitespace, it should be mentioned in the form element with the right syntax
d) Whitespace cannot be created with the help of form element
View Answer

Answer: a
Explanation: You should also be aware that when a browser comes across a <form> element it often creates extra white space around that element. This can particularly affect your design if you want a form to fit in a small area, such as putting a search form in a menu bar.

6. What is a target attribute?
a) It is used to indicate the browser to which part of the form the data should be filled in
b) To indicate which frame or browser window the link should be loaded into
c) To identify the incorrect format inputs in a form
d) It is used to open a specific form on a webpage
View Answer

Answer: b
Explanation: The target attribute is usually used with the <a> element to indicate which frame or browser window the link should be loaded into. It can also be used with a form to indicate which frame or window the form results open in when the user has submitted a form.

7. What are the three basics of programming a form-based document?
a) Design the input form, writing an application program, design the document which is generated by the user
b) Filling a form, processing a form, submitting the form
c) Filling a form, submitting a form, web browser response
d) Designing a form, processing it to the server, response from the web browser
View Answer

Answer: a
Explanation: First step is the designing of the input form. After designing the input from, to interpret the data from the input form, application program is written. As a reply to the user, the program which is generated is designed as a document.
advertisement

8. When do you use GET?
a) It is used to mention a specific method in which the form attributes must be included
b) It is the method which the user chooses when submitting a form
c) It is the default method while submitting a form
d) GET method is used to get the values from the Form
View Answer

Answer: c
Explanation: GET is a default method while submitting a form. When the GET method is used the submitted data in the form is visible in the page address field. The length of the URL is limited.

9. <input type=”radio”> statement is used to create?
a) A radio form
b) A radio button
c) It is the name of the form
d) Checkbox
View Answer

Answer: b
Explanation: It the syntax to create a radio button. Radio button helps in selecting one of many choices. Similarly, <input type=”submit”> is used to create submit button. The syntax to create Text field is <input type=”text”> which defines a one-line text input field.
advertisement

10. What is the default width of text field?
a) 10 characters
b) 20 characters
c) 30 characters
d) 40 characters
View Answer

Answer: d
Explanation: The default width of a text field is twenty characters. The character limit of the text field can be extended with the proper syntax by mentioning the size of the text field you want to create. The 20 character limit is for the one-line text input field.

Sanfoundry Global Education & Learning Series – Web Technology.

To practice all areas of Web Technology, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.