How to use the textbox value to fetch the records and to display it in the same page
- by Aruna
Hi,
i am having a Form like
<script language="javascript" type="text/javascript">
function formfn()
{
var str = document.getElementById('TitleSearch').value;
alert(str);//displays the keyword like database
}
</script>
<form name="f1" method="post">
<p><label for="TitleSearch">Keywords:</label>
<input title="Keyword" size="40" value="" id="TitleSearch"></p>
<p>
<input type="submit" id="im-search" value="Search" name="im-search" onClick="formfn();"></p>
</form>
I am having a page where in the top i have this form on search it has to take the value of the textbox TitleSearch and to use this to retrieve the records matching by
<?php
$db =& JFactory::getDBO();
$query = 'SELECT * from #__chronoforms_Publications where keyword like "%valueretrieved%" ';
$db->setQuery($query);
$rows = $db->loadObjectList();
//echo $rows;
?>
Once the search button is clicked the text box value of the keyword is retrieved .
I am trying to use this value in the select query to fetch the records and to display in the same page..
How to do so..