T
toufik toufik
Hi,
I've in amy HTML a form that contains 2 inputs, and an href taht has no
action
using javascript (href onclick event) I like to submit the form when the
user clic on the link, (stop teh href default action and replace it by the
submit in the onclic event)
I've tried this code but it doesn't work..
Any help please.
<html>
<title>Parsing Pasword Form Elements</title>
<body>
<script>
function go(xtel)
{
document.forms[0].action="test1.php?tel="+xtel;
document.forms[0].submit();
}
</script>
<form action="test1.php" METHOD="POST" >
<input type="text" name="nom" />
<input type="text" prenom="prenom" />
<a href="" onclick="go('1234');">Link 1</a>
</form>
</body>
</html>
I've in amy HTML a form that contains 2 inputs, and an href taht has no
action
using javascript (href onclick event) I like to submit the form when the
user clic on the link, (stop teh href default action and replace it by the
submit in the onclic event)
I've tried this code but it doesn't work..
Any help please.
<html>
<title>Parsing Pasword Form Elements</title>
<body>
<script>
function go(xtel)
{
document.forms[0].action="test1.php?tel="+xtel;
document.forms[0].submit();
}
</script>
<form action="test1.php" METHOD="POST" >
<input type="text" name="nom" />
<input type="text" prenom="prenom" />
<a href="" onclick="go('1234');">Link 1</a>
</form>
</body>
</html>