Show Mobile Navigation

Ads

Monday 21 October 2013

AutoComplete Textbox in HTML using DataList

Unknown - Monday, October 21, 2013
Here am going to explain HTML textbox autocomplete without using any dynamic code
Recently HTML has released one new HTML tag for auto Complete Textbox DataList Tag.
                                                               Demo Snippet
 
Here is the Sample Code

<html>
<head>
    <title>Data List tag in HTML</title>
    <script type="text/javascript">
        function fundatalist() {
            if (document.getElementById('SelectOS').value != '') {
                alert(document.getElementById('SelectOS').value);
            }
            else {
                alert('Please Select OS Type');
                document.getElementById("SelectOS").focus();
            }
         }
    </script>
</head>
<body>
Ex: Android OS,iOS,Windows 8 OS,Blackberry OS,Symbian OS
Type atleast one letter from above words:<br />
<input list="MobileOS" name="SelectOS" id="SelectOS" placeholder="enter atleast one letter">
<datalist id="MobileOS">
  <option value="Android OS">
  <option value="iOS">
  <option value="Windows 8 OS">
  <option value="Blackberry OS">
  <option value="Symbian OS">
</datalist>
<input type="submit" onclick="fundatalist()"><br />
</body>
</html>

0 comments:

Post a Comment