increment hidden variable value
Posted: Thu Jun 18, 2009 1:55 am
hi,
I get variable value from hidden element in form.
I want to increment it by 1 every time i click on "add"
This is my full code:
Javascript :
Here is my html code :
But this code only display 0 on alert box.
I want to increment hidden element value by 1.
So please help me
Thanks in advance
I get variable value from hidden element in form.
I want to increment it by 1 every time i click on "add"
This is my full code:
Javascript :
Code: Select all
<script language="javascript">
function add() {
var disp =document.f3.cou.value;
var sel =disp++;
document.f3.cou.value=sel;
alert(sel);
</select>
Code: Select all
<form action="new.php" method="post" name="f3" enctype="multipart/form-data">
<input id="cou" type="hidden" name="cou" value="0" /><a href="javascript:addanother()" class="choose-links">+ Add Another</a>
<form>
I want to increment hidden element value by 1.
So please help me
Thanks in advance