cmb Posted October 19, 2011 Share Posted October 19, 2011 This is what i would like to do and i have no idea how to, pleas help i want to get the value of a text box add 1 to it and then update what that text box says Link to comment https://forums.phpfreaks.com/topic/249357-adding/ Share on other sites More sharing options...
Adam Posted October 19, 2011 Share Posted October 19, 2011 Can you show the mark-up you're working with? There's a number of ways to do it. Link to comment https://forums.phpfreaks.com/topic/249357-adding/#findComment-1280473 Share on other sites More sharing options...
cmb Posted October 19, 2011 Author Share Posted October 19, 2011 After i posted this i acutally figured this out but i was wondering if their was a better way of doing it <form id="form6" name="form6" method="post" action=""> <input name="gsavebtn" type="button" id="gsavebtn" value="Saves" onClick="add()"/> <input name="gsave" type="text" id="gsave" value="0" size="2" readonly /> </form> <script type="text/javascript"> function add() { var bm = document.getElementById('gsave').value; var am = bm * 1 + 1; document.getElementById('gsave').value = am; localStorage.setItem( "gsave", am ) } </script> Link to comment https://forums.phpfreaks.com/topic/249357-adding/#findComment-1280670 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.