Know User Interest by Predefine Fields
Home Courses Community Support
Know User Interest by Predefine Fields

To know user interest by predefine fields, we use checkboxes, redio buttons and dropdown list. For example you are providing four services through your website then you can give an option to user for select services before he submit enquery form. You can do so by using checkbox.

See below code for checkboxes-

<h4>Select services, you are interested in</h4>
<label>Service1</label> <input name="service1" type="checkbox" ><label>Service2</label> <input name="service2" type="checkbox" ><label>Service3</label> <input name="service3" type="checkbox" ><label>Service4</label> <input name="service4" type="checkbox" ><br><br>

Above code will give four checkbox to user. User can select multiple checkbox. If you want to give option to select only one selection then you can give dropdown. 

See below code for dropdown list-


The above code will show a dropdown list to user.

<select> tag has some attributes given below-
<autofocus> This is HTML 5 attribute. It make focus on list when page load.
<disabled> Used to disable the list item. We can also use this attribute to disable list.

enlightenedWe disable list items when we have multiple items and subitems for them. In this situation disabled list items can be used to represent category. For example, above four serservices can be mentioned under service.

<multiple> Define that multiple options can be selected together.
<required> This attribute make the list item selection mendatory for user. He will not able to submit the form if not item is selected. It is a HTML5 attribute.
<size> This attribute is used to make visible to more then one item.

To give option to select only one item we can use redio button as well. Generally this button is used to get user input from few options. For example, you want to know the sex of user then you will give redio button.

See below code for redio button-

<label>Male</label> <input name="male" type="radio" >
<label>Female</label> <input name="female" type="radio" >

The above code will display two redio buttons to select sex.

← Preview

Placeholder vs Value

Next →

Introduction to HTML5


Our mission is to provide highly effective and quality education via innovative solutions. Geeksdemy look forward to bridge the gap between in-demand technology and academics in order to deliver innovative, easy, interesting and affordable learning across the Globe.


  • Python
  • Game Development with Unity 3D
  • Arduino
  • PCB & Circuit Designing
  • Robotics and Embedded C
  • 8051/8052 Embedded Systems
  • QuadCopter & UAV
  • MATLAB with Robotics
  • Raspberry Pi
Learn On the Go!
Get the Android App
Get the iOS App