Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: text value addition problem

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Arrow text value addition problem

    hi friends!!!!!!!!!!
    i am doing a lottery project in which i have 10 textbox and i want to add contents of each textbox and
    show result in another textbox say 11th textbox.
    I am having the fallowing codes below on jsp page.
    //.................................................. .................................................. ................................

    <html>
    <table>
    <tr >
    <td style="color:beige">50 Rs 501</td>
    <td><input type="text" value="" name="n50" size="5" onkeypress="return isNumberKey(event);"/></td>
    <td><input type="text" value="" name="n51" size="5" onkeypress="return isNumberKey(event);" /></td>
    <td><input type="text" value="" name="n52" size="5" onkeypress="return isNumberKey(event);"/></td>
    <td><input type="text" value="" name="n53" size="5" onkeypress="return isNumberKey(event);"/></td>
    <td><input type="text" value="" name="n54" size="5" onkeypress="return isNumberKey(event);"/></td>
    <td><input type="text" value="" name="n55" size="5" onkeypress="return isNumberKey(event);"/></td>
    <td><input type="text" value="" name="n56" size="5" onkeypress="return isNumberKey(event);"/></td>
    <td><input type="text" value="" name="n57" size="5" onkeypress="return isNumberKey(event);"/></td>
    <td><input type="text" value="" name="n58" size="5" onkeypress="return isNumberKey(event);"/></td>
    <td><input type="text" value="" name="n59" size="5" onkeypress="return isNumberKey(event);"/></td>
    <td><input type="text" value="" name="n60" size="5" onkeypress="return isNumberKey(event);" onFocus=" show4();"/></td>

    </tr>
    <table>
    </html>
    //here on above code i have 11 textbox
    named (n50,n51.....n60)
    I want to add contents of textbox from(n50,n51.....n59) and show result in another textbox named (n60)
    .................................................. .................................................. ............................
    // friend my question is that the valus stored in textbox is numeric and when i enter the value in any two of the textbox say named (n50 and n51) then the addition of its value must be seen in the result textbox say (n60) here.
    it does not wait for another textbox value which is left blank.
    the result of addition should be displayed simelteneously as i enter the value in text box.


    how is it possible friend?????????????????
    plzzzzzzzzz suggest???????????????????????


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: text value addition problem

    This is not a jsp/java problem, but something that can be done using javascript. See Javscript Tutorial

Similar Threads

  1. File I/O Modify Text Problem
    By Fordy252 in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: November 26th, 2010, 05:30 AM
  2. text.length method problem?
    By computercoder in forum What's Wrong With My Code?
    Replies: 6
    Last Post: November 3rd, 2010, 10:40 AM
  3. Vector Addition with small numbers giving NaN
    By Zula in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 28th, 2010, 09:29 PM
  4. java. Text problem...
    By Ranger-Man in forum Java SE APIs
    Replies: 8
    Last Post: September 7th, 2009, 07:19 PM
  5. [SOLVED] Please Review My Code (Long Integer Addition)
    By Saradus in forum Java Theory & Questions
    Replies: 10
    Last Post: July 4th, 2009, 12:55 PM