Page 80 - TP_Prime_V2.2_Class8
P. 80

</FORM>

                  </BODY>
                  </HTML>

                  Adding  DataList
                  To  provide  input  suggestions  while  allowing  the  user  to  submit  input  directly,  use  the
           Prime (Ver. 2.2)-VIII  The <datalist> element provides a list of options for the user to select from, but it also
                  <datalist> element.



                  allows the user to enter their own input freely in an associated <input> field.
                  To add the data list in the form, follow the syntax as given below:


                  <INPUT LIST="list type" NAME="name of the list">
                  <DATALIST ID="Id of list">

                  <OPTION VALUE="Option1">
          78      <OPTION VALUE="Option2">

                  <OPTION VALUE="Option3">

                  <OPTION VALUE="Option4">

                  </DATALIST>
                  For example:


                  <INPUT LIST="Countries" NAME="Country">
                  <DATALIST ID="Countries">

                  <OPTION VALUE="India">

                  <OPTION VALUE="China">
                  <OPTION VALUE="Indonesia">

                  <OPTION VALUE="Pakistan">

                  <OPTION VALUE="Bangladesh">
                  <OPTION VALUE="Japan">

                  </DATALIST>
                  The above code will create a drop-down list in which these countries names are available.

                  Let us create a web page to display the datalist.

                  <!DOCTYPE HTML>
                  <HTML>

                  <HEAD>
                  <TITLE>Countries</TITLE>

                  </HEAD>
   75   76   77   78   79   80   81   82   83   84   85