Hi Forum,
I am calling 2 pages as per the selection of radio button…Using Js…
I also want to add 2 parameters
- Id
- Title
But I have no idea as how to do this with Js function…here’s the function I am using…
HTML Code:
function doSearch()
{
doSub=true; var dd = document.getElementById(‘city_search’); var value = value=dd.options[dd.selectedIndex].value;
if(document.getElementById(‘company’).checked){
//change the action value of the first <form>
document.getElementsByTagName(‘form’)[0].action=“srch/searchname.php”;
if(document.getElementById(‘city_search’).value==“”||document.getElementById(‘city_search’).value==“Select City”){
alert(“Please select city first!”);
document.getElementById(‘city_search’).focus();
doSub=false;
}
else if(document.getElementById('get_searchword').value==""){
alert("Please enter category / company name for search.");
document.getElementById('get_searchword').focus();
doSub=false;
}
}
else{
document.getElementsByTagName('form')[0].action="srch/searchkey.php";
if(document.getElementById('city_search').value==""||document.getElementById('city_search').value=="Select City"){
alert("Please select city first!");
document.getElementById('city_search').focus();
doSub=false;
}
else if(document.getElementById('get_searchword').value==""){
alert("Please enter category / company name for search.");
document.getElementById('get_searchword').focus();
doSub=false;
}
}
//submit the form
if(doSub===true){
document.getElementsByTagName('form')[0].submit();
}
}
Above I am Calling 2 pages…searchname.php & searchkey.php… I need it something like…searchkey.php?id=1&title=603…
Please help…as I am new for PHP…
Thanks a lot.