“Submit is not a function” error in JavaScript

Can anyone tell me what is going wrong with this code? I tried to submit a form with JavaScript, but an error “.submit is not a function” shown. See below for more details of the code: <form action=”product.php” method=”get” name=”frmProduct” id=”frmProduct” enctype=”multipart/form-data”> <input onclick=”submitAction()” id=”submit_value” type=”button” name=”submit_value” value=””> </form> <script type=”text/javascript”> function submitAction() { document.frmProduct.submit(); … Read more

Two submit buttons in one form

I have two submit buttons in a form. How do I determine which one was hit serverside? 22 s 22 Solution 1: Give each input a different value and keep the same name: <input type=”submit” name=”action” value=”Update” /> <input type=”submit” name=”action” value=”Delete” /> Then in the code check to see which was triggered: if ($_POST[‘action’] … Read more

JavaScript post request like a form submit

I’m trying to direct a browser to a different page. If I wanted a GET request, I might say document.location.href=”http://example.com/q=a”; But the resource I’m trying to access won’t respond properly unless I use a POST request. If this were not dynamically generated, I might use the HTML <form action=”http://example.com/” method=”POST”> <input type=”hidden” name=”q” value=”a”> </form> … Read more