Loading...
Please wait while we prepare your content
Please wait while we prepare your content
Solutions for Computer Applications, Class 10, CBSE
Which Input attribute of HTML form specifies the initial value to the field?
Value
Which button is used to clear the contents of a form?
Reset
Which form control allows a user to make a selection of only one option among the several possible options?
Radio Button
Which attribute is used to preselect Checkbox?
Checked attribute
Name the form control which acts like a toggle switch which helps the user to select or deselect more than one item.
Checkbox
Name the attribute used to indicate that the choice in a drop-down list is preselected.
Selected attribute
Which attribute of the drop-down list is used to add a scroll feature to it?
Size
Name the entity used to select multiple options from the items displayed in a list.
Multiple
Shagun wants to customize the width and height of the textarea in her form. How can she do it?
Shagun can use the Rows and Cols attribute of the <TEXTAREA>
tag to customize the width and height of the textarea in her form. Rows attribute defines the height of the textarea, and Cols attribute defines the width of the text area. Example code for customizing the width and height of the textarea is:
<TEXTAREA ROWS = "6" COLS = "50" NAME = "REMARKS">
Enter your remarks here.
</TEXTAREA>
Write the HTML code to create the following form elements:
HTML code to create the form elements is given below:
<HTML>
<HEAD>
<TITLE>Pizza Selection</TITLE>
</HEAD>
<BODY>
<FORM>
Pizza Size : <BR>
<INPUT TYPE = "RADIO" ID = "R1" NAME = "SIZE" VALUE = "SMALL" />
<LABEL FOR = "R1"> Small </LABEL>
<BR>
<INPUT TYPE = "RADIO" ID = "R2" NAME = "SIZE" VALUE = "MEDIUM" CHECKED/>
<LABEL FOR = "R2"> Medium </LABEL>
<BR>
<INPUT TYPE = "RADIO" ID = "R3" NAME = "SIZE" VALUE = "LARGE" />
<LABEL FOR = "R3"> Large </LABEL>
<BR>
<INPUT TYPE = "SUBMIT" NAME = "Process Order" VALUE = "Click to order Pizza" />
<INPUT TYPE = "RESET" NAME = "Clear" VALUE = "Click to Clear" />
</FORM>
</BODY>
</HTML>
In the examination, Suparna has been asked to write the code for placing a drop-down list in the form area. She is also asked to indicate any one of the menu items as preselected. Help her in solving the problem.
Suparna can use the selected attribute with the <OPTION>
tag to indicate that one of the menu items is preselected.
Consider the following example in which the user has to select his destination. Here, the option "Chandigarh" is pre-selected.
<HTML>
<HEAD>
<TITLE>Drop-down Example</TITLE>
</HEAD>
<BODY>
<FORM>
<P> Select your destination: </P>
<SELECT Name = "Cities">
<OPTION Selected> Chandigarh</OPTION>
<OPTION> Kolkata </OPTION>
<OPTION> Bhopal </OPTION>
<OPTION> Lucknow </OPTION>
<OPTION> Patna </OPTION>
<OPTION> Shimla </OPTION>
<OPTION> Delhi </OPTION>
<OPTION> Mumbai </OPTION>
<OPTION> Chennai </OPTION>
</SELECT>
</FORM>
</BODY>
</HTML>
A Form is a collection of ............... of information on a page.
A Form is a collection of fields of information on a page.
A ............... allows a user to enter alphanumeric data that is a combination of characters and numbers.
A Textbox allows a user to enter alphanumeric data that is a combination of characters and numbers.
A ............... is like a toggle switch, which helps the user to select or deselect one or more than one items.
A Checkbox is like a toggle switch, which helps the user to select or deselect one or more than one items.
When the user has to make a selection among the several possible options, ............... buttons are used.
When the user has to make a selection among the several possible options, Radio buttons are used.
............... programs are required to process the information present in a form.
CGI programs are required to process the information present in a form.
Two important attributes to set up a form are ............... and ............... .
Two important attributes to set up a form are Action and Method.
The default value of Method attribute is ............... .
The default value of Method attribute is Get.
The ............... attribute of form specifies the file/page that the form is submitted to.
The Action attribute of form specifies the file/page that the form is submitted to.
The ............... attribute of <INPUT> tag specifies the initial value for the field.
The Value attribute of <INPUT> tag specifies the initial value for the field.
The ............... tag is used along with the <SELECT> tag to display a list of options.
The <OPTION> tag is used along with the <SELECT> tag to display a list of options.
What do you understand by the Method attribute? Differentiate between the Get method and the Post method.
The Method attribute specifies that the form information should be posted to the URL given in the action attribute. Possible values are GET and POST.
Differences between the Get method and the Post method are:
S. No. | Get Method | Post Method |
---|---|---|
1. | Form data is sent as part of URL. | Form data is sent as part of request body. |
2. | Less data can be sent compared to Post method. | More data can be sent compared to Get method. |
3. | Less secure. | More secure. |
4. | Can be bookmarked. | Cannot be bookmarked. |
Explain any two input elements.
Two input elements are as follows:
<INPUT Type= "Text">
<INPUT Type = "Checkbox" Name = "Hobbies" Value = "Reading">
The below example shows the usage of textbox and checkbox in a form:
<HTML>
<BODY>
<FORM>
<P>
NAME :
<INPUT TYPE = "TEXT">
</P>
<P>
CHOOSE YOUR QUALIFICATION : <BR>
<INPUT TYPE = "CHECKBOX" NAME = "C1" VALUE = "GRADUATE">
GRADUATE <BR>
<INPUT TYPE = "CHECKBOX" NAME = "C2" VALUE = "POSTGRADUATE" >
POST GRADUATE
</P>
</FORM>
</BODY>
</HTML>
Differentiate between:
1. Differences between Radio Button and Checkbox:
S. No. | Radio Button | Checkbox |
---|---|---|
1. | Radio buttons are used when we want users to select only one option from a set of choices. | Checkboxes are used when we want users to select multiple options from a list. |
2. | Radio buttons are typically represented as small circles or dots, and users can select only one of them at a time. | Checkboxes are typically represented as small square boxes with a check mark inside them. |
3. | Selecting one option automatically deselects any previously selected option within the same group. | Users can check or uncheck checkboxes independently. |
2. Differences between Submit Button and Reset Button:
S. No. | Submit Button | Reset Button |
---|---|---|
1. | Submit button is used to send the data entered in the form to the server for processing. | A reset button is used to clear or reset the contents of a form, reverting all form fields back to their default or initial values. |
2. | It is defined as follows:<INPUT Type = "Submit" Value = "SEND"> | It is defined as follows:<INPUT Type = "Reset" Value = "RESET"> |
Write a short note on the application areas of forms.
Forms have diverse application areas which include the following:
Define the following attributes associated with the <INPUT>
tag:
i. Type
ii. Value
iii. Size
i. Type — This attribute specifies what kind of form control will be added to the form. The default type for an input element is "Text". Type attribute can take different values like "Text", "Checkbox", "Radio" or "Password".
ii. Value — It specifies the initial value for the element.
iii. Size — It specifies the width of the input field.
Describe the Cols attribute and Rows attribute of the <TEXTAREA>
tag.
Rows attribute of the <TEXTAREA>
tag defines the height of the textarea and Cols attribute of the <TEXTAREA>
tag defines the width of the text area.
Consider the following example,
<HTML>
<HEAD>
<TITLE>Using text area</TITLE>
</HEAD>
<BODY>
<FORM>
Remarks : <TEXTAREA ROWS = "6" COLS = "50" NAME = "REMARKS">
Enter your remarks here. </TEXTAREA>
</FORM>
</BODY>
</HTML>
Which element sets up an area of the web page for a form?
Form element
Reason — The form element sets up an area of the web page for a form.
Which form elements can accept input from the user?
Input
Reason — The Input form elements can accept input from the user.
Which of the following code adds a text box on a form?
<INPUT Type = "Text">
<INPUT Type = "Textbox">
<INPUT Type = "Box">
<INPUT Type = "Text">
Reason — <INPUT Type = "Text">
adds a text box on a form.
Which of the following buttons is used to clear the contents and set the values of all the form elements to their initial state?
RESET
Reason — The RESET button is used to clear the contents and set the values of all the form elements to their initial state.
Which tag is used to define a selection list in a form?
<OPTION>
<SELECT>
<NAME>
<SELECTION>
<SELECT>
Reason — <SELECT>
tag is used to define a selection list in a form.
CGI stands for .............. .
Common Gateway interface
Reason — CGI stands for Common Gateway interface.
Which of the following are the attributes of the <INPUT>
tag?
Value and Size
Reason — Value and Size are the attributes of the <INPUT>
tag. Value specifies the initial value for the element and Size specifies the width of the input field.
Which attribute of the <INPUT>
tag specifies that the input element should be preselected when the web page loads?
Checked
Reason — Checked attribute of the <INPUT>
tag specifies that the input element should be preselected when the web page loads.
The ............... attribute of <INPUT>
tag specifies the maximum number of characters for the input field.
Maxlength
Reason — The Maxlength attribute of <INPUT>
tag specifies the maximum number of characters for the input field.
Which attribute of the <TEXTAREA>
tag defines the width of the textarea?
Cols
Reason — The Cols attribute of the <TEXTAREA>
tag defines the width of the textarea.
Name the attributes which are used with the <INPUT>
tag.
The attributes which are used with the <INPUT>
tag are:
Which tag helps in creating a drop-down list on a form area?
The <SELECT>
tag along with the <OPTION>
tag is used to create a drop-down list on a form area.
Which attribute of <INPUT>
tag specifies what type of form control will be added to the form area?
The 'type' attribute of <INPUT>
tag determines the type of form control that will be added to the form area
Which tag adds a multi-line text box on the form area?
The <TEXTAREA>
tag adds a multi-line text box on the form area.
A form is divided into how many sections?
A form can be divided into three sections:
What is the purpose of a password field?
The purpose of a password field is to securely input and hide confidential information like passwords or PINs by displaying dots or asterisks instead of the actual data.
What is the purpose of a scroll bar added with a combo box?
A scroll bar added to a combo box indicates that there are more elements in the list and helps to navigate through this longer list of options.
How can you select multiple options from the items displayed in a list?
We can select multiple options from the items displayed in a list by using the entity "multiple". The Ctrl or Shift keys are used to select more than one element from the list.
A drop-down list displays a list of options from which the user can select an item.
True
Reason — A drop-down list displays a list of options from which the user can select an item.
Radio button is a toggle switch used to select or deselect one or more items.
False
Reason — Radio button is a toggle switch used to select only one item out of many given items.
Forms can be classified into three sections.
True
Reason — Forms can be classified into three sections —
The Input element sets up an area for a form on the web page.
False
Reason — The Input elements are the form elements that can accept input from the user.
Generally, we require one element to create a form in HTML.
False
Reason — Generally, we require two elements to create a form in HTML —
The Button element creates button controls.
False
Reason — The Input element with Type attribute as 'Submit' or 'Reset' creates button controls.
The Label element is used to describe the Form controls.
True
Reason — The Label element is used to describe the Form controls.
The <INPUT>
tag is used to create multi-line text box.
False
Reason — The <TEXTAREA>
tag is used to create multi-line text box.
Maxlength attribute specifies the width of the input field.
False
Reason — Maxlength attribute specifies the maximum number of characters that the user can enter into the input field.
The <OPTION>
tag is used with an <INPUT>
tag to display a list of options.
False
Reason — The <OPTION>
tag is used with a <SELECT>
tag to display a list of options.
Rows attribute defines the height of the Textarea.
True
Reason — Rows attribute defines the height of the Textarea.