ash
Aug 23 2008, 10:36 PM
I want to create a form without submit button, just have it be sent without any user action. Here is the code that I have, any help would be greatly appreciated!
<form action="http://<url>" method="post">
<input type="hidden" name="requestXML" value= "<c:out value="${test}" />" />
<input type="hidden" name="clientURL" value= "http://<url>" />
<input id="next" type="submit" value="Submit" />
</form>
pandy
Aug 23 2008, 11:23 PM
Well, you can let JavaScript submit the form onload. Which, of course, isn't reliable.
ash
Aug 24 2008, 01:52 PM
What i am really wanting to do is send an http post and adding in the key/value pairs in the post. Is there any other way to do this in html besides in a form.
pandy
Aug 24 2008, 02:40 PM
Do you mean you want a URL with a query string? Like
http://example.com?key=value ?
ash
Aug 24 2008, 02:58 PM
no because of the size restriction of sending the data in the url I need to do a post and send the data in the headers.
Darin McGrew
Aug 24 2008, 05:05 PM
HTML can't do that unless the user submits the form.
JavaScript can do it automatically, with the usual exceptions (JavaScript disabled, JavaScript unavailable, security/firewall features blocking form submissions, etc.).
ash
Aug 24 2008, 08:59 PM
how would I do this in javascipt?
pandy
Aug 24 2008, 09:08 PM
CODE
function submitForm()
{
document.myform.submit();
}
onload = submitForm;
HTML
<form name="myform"...>
...
</form>
ash
Aug 24 2008, 11:29 PM
thanks for the help!!, it worked perfectly
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.