Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submiting form with href problem

Status
Not open for further replies.

dessie1981

Programmer
May 9, 2006
116
GB
Hi Everyone,

Hi i am having a problem submiting my form using a link.

Here's my code

<html>
<head>
<title>
form test
</title>
</head>
<body>
<script type="text/javascript">
<!--
function formSubmit()
{
document.myform.submit();
}
//-->
</script>
<form name="myform" method="post" action="formtest2.php">
<input type="text" name="purchaseid">
</form>
<!-- "navigate" to somewhere -->
<p>
<A HREF="formtest2.php" onclick="formSubmit()">confirm & navigate to somewhere else</A>
</p>

</body>
</html>

On trying to recieve the parameter i get the Notice : Undefined index: purchaseid

<?

echo "\n";
echo $_POST['purchaseid'];
?>


Can anyone help?
 
can you try substituting the following link code
Code:
<a href=# onclick="formSubmit(); return false;">Submit</a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top