Help - Search - Members - Calendar
Full Version: HTML - creating a form without a submit button
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
ash
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
Well, you can let JavaScript submit the form onload. Which, of course, isn't reliable.
ash
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
Do you mean you want a URL with a query string? Like http://example.com?key=value ?
ash
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
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
how would I do this in javascipt?
pandy
CODE
function submitForm()
{
   document.myform.submit();
}
onload = submitForm;



HTML
<form name="myform"...>
...
</form>
ash
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.
Invision Power Board © 2001-2010 Invision Power Services, Inc.