I am new in php.I have a script that work fine.but the problem is that i want to pass the id of the name completed.
My input text:
<tr><td>Marital Status</td><td><input type="text" id="m_status"
name="m_status" value="<?php echo $ddlMarital >0 ?
$MartialArray[$ddlMarital] : '' ;?>"></td></tr>
Script:
$(function() {
$( "#m_status" ).autocomplete({
source: 'Getmstaus.php'
});
Getmstaus.php:
<?php
include("include/connection.php");
$searchTerm = $_GET['term'];
//get matched data from skills table
$query = $db->query("SELECT * FROM m_status WHERE m_status LIKE
'%".$searchTerm."%' ORDER BY m_status ASC");
while ($row = $query->fetch_assoc()) {
$data['name'] = $row['m_status'];
$data['id'] = $row['m_id'];
}
echo json_encode($data);
Now I get M_status name
and if i submit the form that m_status
will submit.But i want to display m_status
and while form submit i want to submit m_id
.How can i do this?Please help me.Any help would be appreciated.