The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HTML - creating a form without a submit button
ash
post 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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
ash
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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 ?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
ash
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post 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.).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
ash
post 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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
ash
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 07:48 AM