I want to execute some php code on submit button click without refreshing/reloading my page. Is it possible? also i have javascript function on page load that's why i don't want to refresh my page.
thanks in advance.
<?php
if(isset($_POST[search]))
{
$show = SELECT * FROM data;
$rs = mysql_query($show) or die(mysql_error());
$add_to_textbox = <input type='button' name='btn' value='add' />;
#****results in Grid****
echo <table width='360px' border='1' cellpadding='2'>;
$rowID=1;
while($row = mysql_fetch_array($rs))
{
echo <tr>;
echo <td width='130px' id='name.$rowID.'>$row[Name]</td>;
echo <td width='230px' id='link.$rowID.'><a href = '$row[Link]'>$row[Link]</a></td>;
echo <td width='130px' onclick='Display($rowID);'>$add_to_textbox</td>;
echo </tr>;
$rowID++;
}
echo </table>;
#**********************
mysql_free_result($rs);
}
?>
<script type=text/javascript>
function Display(rowID){
var linkVal = document.getElementById('link'+rowID+'').innerHTML.replace(/</?[^>]+(>|$)/g, n);
document.getElementById(name).value = document.getElementById('name'+rowID+'').innerHTML;
document.getElementById(link).value = linkVal;
}
</script>
here is my code