Solved

i want to pass info from one page to onther using the post command but

Posted on 2008-10-07
3
164 Views
Last Modified: 2011-09-20
i want to pass info from one page to onther using the post command but i want the info to be passed when i click on a link and not on a button
for example
-------------------------------------------------------------------------------------------------------------
 <form id="form1" name="form1" method="post" action="test33.php">
  1
</form>
-------------------------------------------------------------------------------------------------------------
i wanted to pass the info to test33.php when i click on the number 1
is that posible?
0
Comment
Question by:mgtm3
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
kelvinwkw earned 250 total points
Comment Utility
<script>
function do_onClick(obj){
obj.submit();
}
</script>

<a href='#' onclick='do_onClick(document.form1);'/>
0
 
LVL 11

Expert Comment

by:kelvinwkw
Comment Utility
<script>
function do_onClick(obj){
obj.submit();
}
</script>


 <form id="form1" name="form1" method="post" action="test33.php">
<a href='javascript:void(0);' onclick='do_onClick(document.form1);'>1</a>

</form>
0
 
LVL 3

Assisted Solution

by:DerkArts
DerkArts earned 250 total points
Comment Utility
or even shorter:

 <form id="form1" name="form1" method="post" action="test33.php">
  <a href='javascript:void(0);' onclick='document.form1.submit()'>1</a>
</form>

if you change the form name, you need to change the form name in the onclick action!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now