139
rated 0 times
[
146]
[
7]
/ answers: 1 / hits: 113775
/ 12 Years ago, tue, october 9, 2012, 12:00:00
I have this text field and button here
<input name=txtSearch type=text id=txtSearch class=field />
<input type=submit name=btnSearch value= id=btnSearch class=btn onclick=javascript:SubmitFrm() />
and when the user clicks on the submit button this function is suppose to run
<script type=text/javascript>
function SubmitFrm(){
var Searchtxt = document.getElementById(txtSearch).value();
window.location = http://www.example.com/search/?Query= + Searchtxt;
}
</script>
But nothing happens, what I expecting to happen is when the user clicks on the submit button, take the value from the search text box and redirect the user to the url + the value of the search text box...
What am I doing wrong?
More From » onclick