aspquestions Posted October 12, 2009 Share Posted October 12, 2009 How do I count the number of times a button is being clicked. NOTE: everytime the button is clicked it causes the form to postback.I was going to use a hidden text box.. function increment(){ document.getElementByID("count").value = document.getElementByID("count").value + 1;}<input type="hidden" name="count" value = <%value%><...button onclick = "increment()">But I get an error because the value of the text box is null at first. How do I solve this?Note these are the most important lines of my code. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 12, 2009 Share Posted October 12, 2009 See my response in the other thread, you need to use parseInt to convert the value to a number. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.