Forum Moderators: open
Can anyone help? TIA
<input type="radio" name="formaction" value="1" onClick="this.form.action = 'http://www.google.com/search'; name='f'" checked="checked"> Google Search<br>
<input type="radio" name="formaction" value="2" onClick="this.form.action = 'http://images.google.com/images'; name='f'"> Google Image Search<br>
<input type="radio" name="formaction" value="3" onClick="this.form.action = 'http://www.google.com/custom'; method='get'"> Site Search<br>
<input type="radio" name="formaction" value="4" onClick="this.form.action = 'http://ie.search.msn.com/en-us/srchasst/srchasst.htm'"> MSN Search
<form onsubmit="formaction(this)">
<input type="text" maxlength=255 size=17 name=q value="">
<input type=hidden name=ie value="UTF-8">
<input type=hidden name=oe value="UTF-8">
<input type=hidden name=hl value=en>
<input type="submit" name="sa" value="Search">
<input type="hidden" name="cof" value="AH:center;S:http://mysite.com
<input type="hidden" name="domains" value="mysite.com">
</form>
I also tried assigning a variable to 'this' before the radio buttons.
<script type="text/javascript"> var this.form.action='http://www.google.com/search'; name='f'; target='_main';</script>
Someone please help?
<form onsubmit="formaction(this)">
This line says that when the user clicks the submit button it will call a JavaScript function called formaction. Look for a bit of code something like this:
<script>
function formaction(form) {// ... some code goes in here...
}
</script>
The function will return either true or false depending on whether it decides the form is ready to submit (it probably does some field validation).
If you can't work out what your formaction function is doing, post it here :)
<form onsubmit="(this)">
<input type="radio" name="sitesearch" value="" checked="checked" onClick="this.form.action='http://www.google.com/search'; name='f'; target='_main'"> Google Search<br>
<input type="radio" name="sitesearch" value="" onClick="this.form.action='http://images.google.com/images'; name='f'; target='_main'"> Google Image Search<br>
<input type="radio" name="sitesearch" value="mysite.com" onClick="this.form.action='http://www.google.com/custom'; method='get'; target='_main'"> My Site Search<br>
<input type="radio" name="sitesearch" value="" onClick="onsubmit='return CheckMT(this.q, this.q.value, this)'; this.form.action='http://search.msn.com/spresults.aspx'; method='get'; name='STWF'; target='_self'"> MSN Search<br><br>
<input type="hidden" name="form" value="IE4">
<input type="hidden" name="hl" value="en">
<input type="hidden" name="cof" value="AH:center;S:http://mysite.com;AWFID:45f8820be9938ed4;">
<input type="hidden" name="domains" value="mysite.com">
<input type="text" maxlength="255" size="15" name="q" VCARD_NAME="SearchText" class="qform" value="">
<input type="submit" name="sa" value="Go">
</form>