Results 1 to 5 of 5
  1. #1
    benjibabs is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default Help with event to change output value in a division

    Hi group!

    I am quite new to Java. I need a litlle push; I have been on this for a couple of weeks.

    Here is my code:

    ---
    <html>
    <head>
    <title> Java Lesson</title>
    </head>
    <body>
    <select name="month" onchange="replaceContent()">
    <option value="Jan">January </option>
    <option value="Feb">February </option>
    <option value="Mar">March </option>
    <option value="Apr">April </option>
    </select>
    <select name="team">
    <option value="Ben">Benjamin</option>
    <option value="Ugo">Ugo Boss </option>
    <option value="Mary" >Mary </option>
    <option value="Jean" >Jean Job </option>
    </select>
    <br/>
    <br/>
    <br/>
    <table border="1" width= 50%>
    <tr>
    <td>
    <div id=result>
    <script type="text/javascript">
    var shout=month.value
    var shout1=team.value
    document.write(shout+" "+" "+shout1)
    </script>
    </div>
    </td>
    </tr>
    </table>
    </body>
    <html>
    ---


    The purpose:
    1. select a month
    2.select a team
    3. result= value of month and team selected be displayed side by side in the div.
    I want this to happen immediately after selecting any value from either select box.

    Observations:
    The code works fine if I select any value from any select box and F5, but if I select, and 'close and open' page, both values go to default. What is the difference between refresh via F5 and re-loading page?

    Thanks.

  2. #2
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    4

    Default

    Quote Originally Posted by benjibabs View Post
    I am quite new to Java. I need a litlle push; I have been on this for a couple of weeks.
    First thing to learn: Java isn't JavaScript, not even close. I suggest that you Google for a JavaScript forum to ask this question in.

  3. #3
    robertbob is offline Member
    Join Date
    May 2010
    Posts
    23
    Rep Power
    0

  4. #4
    benjibabs is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default

    Thanks guys, I completely forgot. :)

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. big double division
    By grilo in forum Advanced Java
    Replies: 4
    Last Post: 10-11-2009, 10:07 PM
  2. Problem with division using doubles
    By chrismanahan in forum New To Java
    Replies: 3
    Last Post: 10-10-2009, 09:26 PM
  3. how to discard remainder on division?
    By RobertF in forum New To Java
    Replies: 9
    Last Post: 03-13-2009, 12:20 PM
  4. Any suggestions on what i need tp change for a proper output.
    By PureAwesomeness in forum New To Java
    Replies: 10
    Last Post: 02-24-2009, 12:46 AM
  5. Datepicker Calender - month change event - jquery
    By rmpatel101 in forum Advanced Java
    Replies: 0
    Last Post: 04-02-2008, 06:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •