Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 19th, 2002, 10:12 AM
notbad notbad is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Sunshine Coast, Qld, Australia
Posts: 3 notbad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to notbad
Use a link to submit?

I want to make a link submit the form it's in. I thought I might be able to do something like this but I'm having trouble.

<a href="#" onClick="javascript:this.form.submit()" name="_go">link name<a/>


Any hints will be appreciated.

Reply With Quote
  #2  
Old August 19th, 2002, 04:26 PM
EvilivE EvilivE is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Milwaukee, WI USA
Posts: 291 EvilivE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to EvilivE
RE: Use a link to submit?

php Code:
Original - php Code
  1.  
  2. <html>
  3. <body>
  4. <form name=frmMain action=<? echo $_SERVER['PHP_SELF']; ?> action=get>
  5. <input type=text name=txtName>
  6. <a href=# onClick="document.frmMain.submit();">Submit</a>
  7. </form>
  8. <?
  9. echo "<p>".$_GET['txtName'];
  10. ?>
  11. </body>
  12. </html>

Reply With Quote
  #3  
Old August 20th, 2002, 02:04 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 5
Send a message via Yahoo to bakertrg
RE: Use a link to submit?

You need to change the second action to method but this is nice code.

B

Reply With Quote
  #4  
Old August 20th, 2002, 02:06 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 5
Send a message via Yahoo to bakertrg
RE: Use a link to submit?

If you put a value in the () will that be the value of the submit variable on the next page?

B

Reply With Quote
  #5  
Old August 20th, 2002, 04:56 AM
siteworkspro.com siteworkspro.com is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Sydney, Australia
Posts: 92 siteworkspro.com User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via ICQ to siteworkspro.com Send a message via AIM to siteworkspro.com
RE: Use a link to submit?

no, if you want to submit a key/value, you would use a hidden input

<input type="hidden" name"key" value="value">

Reply With Quote
  #6  
Old August 22nd, 2002, 03:09 AM
Gipz Gipz is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Stockholm, Sweden
Posts: 98 Gipz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via ICQ to Gipz
RE: Use a link to submit?

Does this aproach work in all browsers?

Reply With Quote
  #7  
Old August 22nd, 2002, 09:20 AM
EvilivE EvilivE is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Milwaukee, WI USA
Posts: 291 EvilivE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to EvilivE
RE: Use a link to submit?

One tiny, innocent word ... "all".

I know I am not going to say yes, heck I know of 8 browsers of the top of my head ... not including all the different versions of those eight.

How about this answer: it should work with browsers that support javascript _AND_ the user has it enabled.

Reply With Quote
  #8  
Old August 22nd, 2002, 08:35 PM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 5
Send a message via Yahoo to bakertrg
RE: Use a link to submit?

Could this be used to submit to a new window?

Reply With Quote
  #9  
Old October 4th, 2002, 12:46 AM
sarah's Avatar
sarah sarah is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Auckland, New Zealand
Posts: 127 sarah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 32 sec
Reputation Power: 3
Send a message via ICQ to sarah Send a message via AIM to sarah Send a message via Google Talk to sarah
RE: Use a link to submit?

I have always used a different approach but I believe you can have a target attribute in your <form> tag.

Additionally if your hyperlink is inside the form it can be <a href="javascript:submit();">click me</a>

Reply With Quote
  #10  
Old October 5th, 2002, 12:22 AM
marc marc is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 marc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Use a link to submit?

<form method="post" action="<a target="_blank" href="http://www.yourdomainname.com/filename.php">

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Use a link to submit?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek