Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » How to submit a form using a link, not a submit button?


How to submit a form using a link, not a submit button?

Reply
  #1 (permalink)  
Old 04-16-04, 05:04 AM
Myke311 Myke311 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
How to submit a form using a link, not a submit button?

I've got a pretty basic form that i need to be able to "submit" by simply loading it in the browser address, not click the submit button. is there a way to do this? Here is the code:



HTML Code:
<form name="newform" action="/dir/submition.cfm?z=1&Myid=1" method="post">
      <input type="hidden" name="userID" value="27566">

         <input type="submit" value="Submit">
      </form>


if i load just http://www.mysite.com/dir/submition.cfm?z=1&Myid=1, it doesnt do anything because it doesnt have the userID variable, but im not sure how to include that into the address...
Reply With Quote
  #2 (permalink)  
Old 04-16-04, 10:50 AM
AutoObsession87 AutoObsession87 is offline
Newbie Coder
 
Join Date: Mar 2004
Location: Mahopac, NY
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Myke311
I've got a pretty basic form that i need to be able to "submit" by simply loading it in the browser address, not click the submit button. is there a way to do this? Here is the code:



HTML Code:
<form name="newform" action="/dir/submition.cfm?z=1&Myid=1" method="post">
      <input type="hidden" name="userID" value="27566">

         <input type="submit" value="Submit">
      </form>


if i load just http://www.mysite.com/dir/submition.cfm?z=1&Myid=1, it doesnt do anything because it doesnt have the userID variable, but im not sure how to include that into the address...
Hi there,
I don't know if I understand exactly what you need to do. Why do you need a form to do this? Where is the userID coming from, is it always going to be that value? If so you can just hard code it into the URL:
<a href="/dir/submition.cfm?z=1&Myid=1&userID=27566">
That will only work if submition.cfm has a way to handle userID obviously.

Anyways let me know if you can clarify and I can try to help better.

-Scott-
Reply With Quote
  #3 (permalink)  
Old 04-16-04, 11:57 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
you want a link to submit your form !?
because it's not clear what you want.. but if you want the link to submit, I think (but not sure) that you need javascript with OnClick="submit()" in href tag .. but not sure about this..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #4 (permalink)  
Old 01-12-05, 01:26 AM
suren suren is offline
New Member
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
submit from using hyperlink

Hi
i donto know whether u managed to gett the solution or not.
but any way here is the solution
<a href="javascript:submit()">submit</a>
this will simply submit the form.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
submit form with more than one href submit and no submit button adlinfanus JavaScript 1 03-09-04 06:45 AM
First time poster needs help with a mouseover submit form button mess. teh_fonx JavaScript 3 12-21-03 12:19 AM
submit form? tcooper PHP 5 12-12-03 03:30 PM
question on form and submit TxRanger JavaScript 2 11-03-03 11:28 AM
process form without press submit button azwani JavaScript 1 11-03-03 01:10 AM


All times are GMT -5. The time now is 09:25 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.