I just want to redirect the user to google search when he type some thing in text box and then submit, for that i coded:
<script type="text/javascript">
function gotosearch(){
var search = document.getElementById('q').value;
window.location = "http://www.google.com.pk/#hl=en&source=hp&biw=1024&bih=604&q="+search+"&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=1";
return true;
}
</script>
But window.location does not redirect to google page
but I failed…
' 'with'+'and replace other reserved characters with'%xx'hex values)?in the URL before the parameter list. The#character means to go to an anchor (i.e.<a name="foo"></a>) on the page.