Hi, I want post the following instructions from my form, using the "Get" Method I need to post the following: http://www.otherdomain.com/post.aspx?Email=&IPAddress=[IP]&DateTimeStamp=[DATE] However I have no idea how to use the GET and post method using the same form. Can I add this on my existing form page? also how do put a check box so it only submits this if the box is ticked. Thanks
I am using the post method to post information to my database however I need to send data to another website and they have specified that I must use the "GET" method
<script type="text/javascript"> <!-- function fetch_method(form) { if (form.get.checked) { form.setAttribute('method', 'get'); form.setAttribute('action', 'http://new-url.com'); } } //--> </script> <form action="your-url.com/" method="post" onsubmit="fetch_method(this);"> ... Your form <input type="checkbox" name="get" value="1" /> </form> Code (markup): Untested but should work. If the checkbox is checked, it will submit the form using GET to the URL specified in the Javascript. If not, it will POST the form to the URL specified in the action attribute.
Hi, Thanks for your reply, Is it possible to POST every time and only GET if the checkbox is ticked? thanks