Solved

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

Posted on 2008-10-07
3
166 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
ID: 22665486
<script>
function do_onClick(obj){
obj.submit();
}
</script>

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

Expert Comment

by:kelvinwkw
ID: 22665490
<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
ID: 22667202
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

803 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