cu_shane
05-18-2012, 11:35 AM
Here is the code for test.html:
<html>
<head><title></title></head>
<body>
<script type="text/javascript">
function OnSubmitForm(){
document.myform.action ="insert.html";
return true;
}
</script>
<form name="myform" onsubmit="return OnSubmitForm()" method="get">
<input type='radio' name='Search' value='test'>test</input>
</form>
<a href='javascript:document.myform.submit()'><img src='images/buttonnext.jpg'></a>
</body>
</html>
The way I want it to work:
when the img (buttonnext.jpg) is clicked, the form is submitted. When the form is submitted it runs the javascript, which sets the action to be that insert.html is loaded. i.e. the end result should be to redirect to insert.html?Search=test
The way that it is working now:
the page is redirected to test.html?Search=test
Note: If I use a submit button that is part of the form (i.e. input field with type "submit") the page is redirected correctly.
What do I need to change to accomplish my goal?
<html>
<head><title></title></head>
<body>
<script type="text/javascript">
function OnSubmitForm(){
document.myform.action ="insert.html";
return true;
}
</script>
<form name="myform" onsubmit="return OnSubmitForm()" method="get">
<input type='radio' name='Search' value='test'>test</input>
</form>
<a href='javascript:document.myform.submit()'><img src='images/buttonnext.jpg'></a>
</body>
</html>
The way I want it to work:
when the img (buttonnext.jpg) is clicked, the form is submitted. When the form is submitted it runs the javascript, which sets the action to be that insert.html is loaded. i.e. the end result should be to redirect to insert.html?Search=test
The way that it is working now:
the page is redirected to test.html?Search=test
Note: If I use a submit button that is part of the form (i.e. input field with type "submit") the page is redirected correctly.
What do I need to change to accomplish my goal?