0

Hi there, I am stuck in the php validation. In my form have to show list banks by in my form, if the client may be enter the correct name or enter few char and select the bank name from datalist.if Suppose the client enter any name (except exist bank name from list), have to validate like please select banks from database only.

<?php
echo "<input id=\"bankname\" list=\"bankname1\" style='width:400px;' class='form-control' name='bankname' value='$bankname'>
<datalist id=\"bankname1\" >";
$sql="SELECT * FROM bankmaster ORDER BY bankmasterid ASC ";  // Query to collect records
foreach ($DB->query($sql) as $row) 
{
echo  "<option value=\"$row[bank_name]\"/>"; 
}
echo "</datalist>";
?>

Edited by pritaeas: Moved to PHP

2
Contributors
1
Reply
13
Views
2 Years
Discussion Span
Last Post by edbr
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.