I do this all the time. I have a submit button and a print button.
when I click the submit button I submit my page to the same page and when I click the print button i submit my form to a different page.
For some reason I get this message."document.myform.submit is not a function"
When I get rid of my input type "submit" Everything works like it should..
Anyone know whats going on.
Here is my code.
When I add the input type submit the print stops working. Now it works fine
when I click the submit button I submit my page to the same page and when I click the print button i submit my form to a different page.
For some reason I get this message."document.myform.submit is not a function"
When I get rid of my input type "submit" Everything works like it should..
Anyone know whats going on.
Here is my code.
Code:
<script>
function submitform()
{
document.myform.action = 'reportprint.cfm';
document.myform.submit();
}
</script>
<form name="myform" action="reports.cfm" method="post" >
</tr>
<tr><td colspan="8" align="center"><!--- <input type="submit" name="submit" value="submit"> ---></td>
<tr>
<td colspan="8" align="right"><input type="button" name="Print" value="Print" onclick="submitform();"></td>
</tr>
</form>
When I add the input type submit the print stops working. Now it works fine