HTML - creating a form without a submit button |
HTML - creating a form without a submit button |
ash |
Aug 23 2008, 10:36 PM
Post
#1
|
Group: Members Posts: 5 Joined: 23-August 08 Member No.: 6,485 |
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
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
Well, you can let JavaScript submit the form onload. Which, of course, isn't reliable.
|
ash |
Aug 24 2008, 01:52 PM
Post
#3
|
Group: Members Posts: 5 Joined: 23-August 08 Member No.: 6,485 |
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
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
Do you mean you want a URL with a query string? Like http://example.com?key=value ?
|
ash |
Aug 24 2008, 02:58 PM
Post
#5
|
Group: Members Posts: 5 Joined: 23-August 08 Member No.: 6,485 |
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
Post
#6
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
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
Post
#7
|
Group: Members Posts: 5 Joined: 23-August 08 Member No.: 6,485 |
how would I do this in javascipt?
|
pandy |
Aug 24 2008, 09:08 PM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
CODE function submitForm() { document.myform.submit(); } onload = submitForm; HTML <form name="myform"...> ... </form> |
ash |
Aug 24 2008, 11:29 PM
Post
#9
|
Group: Members Posts: 5 Joined: 23-August 08 Member No.: 6,485 |
thanks for the help!!, it worked perfectly
|
Lo-Fi Version | Time is now: 26th April 2024 - 07:48 AM |