By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,068 Members | 874 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,068 IT Pros & Developers. It's quick & easy.

how to remove number one by one in the calculator text box using JavaScript?

P: n/a
how to remove number one by one in the calculator text box using JavaScript. its urgent
Nov 26 '10 #1
Share this Question
Share on Google+
2 Replies


gits
Expert Mod 5K+
P: 5,389
please provide more information - what calculator? what box ... probably you should provide a snippet of code ... so that a reader could follow that issue ...
Nov 26 '10 #2

P: 93
html:
Expand|Select|Wrap|Line Numbers
  1. <form>
  2.             <input type="text" name="display_screen" value="" id="display_screen" />
  3.             <br />            
  4.             <input type="button" name="btn_1" value="1" onclick="add_value(this.value)"/>
  5.             <input type="button" name="btn_2" value="2"  onclick="add_value(this.value)"/>    
  6.             <input type="button" name="btn_3" value="3"  onclick="add_value(this.value)"/>
  7.             <br />
  8.             <input type="button" name="btn_4" value="4"  onclick="add_value(this.value)"/>
  9.             <input type="button" name="btn_5" value="5"  onclick="add_value(this.value)"/>
  10.             <input type="button" name="btn_6" value="6"  onclick="add_value(this.value)"/>
  11.             <br />
  12.             <input type="button" name="btn_7" value="7"  onclick="add_value(this.value)"/>
  13.             <input type="button" name="btn_8" value="8"  onclick="add_value(this.value)"/>
  14.             <input type="button" name="btn_9" value="9"  onclick="add_value(this.value)"/>
  15.             <br />
  16.             <input type="button" name="btn_10" value="0"  onclick="add_value(this.value)"/>
  17.             <input type="button" name="btn_12" value="."  onclick="add_value(this.value)"/>
  18.             <input type="button" name="btn_11" value="00"  onclick="add_value(this.value)"/>
  19.             <br />
  20.             <input type="submit" name="submit" value="SUBMIT" />
  21.             <input type="reset" name="reset" value="CLEAR" />                    
  22.     </form>
javascript
Expand|Select|Wrap|Line Numbers
  1.     <script type="text/javascript">
  2.         function add_value(tmp)
  3.         {
  4.                 document.getElementById("display_screen").value =document.getElementById("display_screen").value + tmp;         
  5.         }
  6.     </script>
May 17 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.