This code has two links with same name but different values. If i click first link, i want to get value 10. Is it possible using javascript with link submit()??
<form name="listpages" action="page.php" method="post">
<input type="hidden" name="pgnum" value="10">
<a href="javascript: document.listpages.submit()"></a>
<input type="hidden" name="pgnum" value="20">
<a href="javascript: document.listpages.submit()"></a>
</form>
thanks in advance
No. But you can use this code to achieve the desired results.:
EDIT
The JavaScript way. I don’t see why you want to stick to JS. Your code will be broken when a user has disabled JavaScript (by using NoScript, for example);