Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Need to display a message if the input is not in the option values

HTML
<input type="text" list="drawingNo"  name="drawingNo1" id="drawingNo1">
 <datalist id="drawingNo">
    <?php 
    while ($docNo=  mysql_fetch_array($doc_no)){        
    ?>
	<option value="<?php echo $docNo['doc_no'];?>">
        <?php } ?>

</datalist>


Please guide me where i stuck
Posted

1 solution

If I get it right you have a list of options like this:

<option> Mike </option>
<option> Steve </option>
<option> Joe </option>


And if user writes into input with id, id="drawingNo1" for example Joe everything is all right, but when he writes Adam it is wrong and you want to show error message?

If that is the case a recommend to use jQuery for this. I can write and example solution for you just let me know if I get it right. ;)

Here is the example: http://codepen.io/xszaboj/pen/oXGOxG?editors=101[^]
 
Share this answer
 
v2
Comments
Bensingh 22-Jun-15 1:02am    
Yes I need to show a message when adam is type by user need to show that data not available in the options

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900