Solved

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

Posted on 2008-10-07
3
168 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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.
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 …

829 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