JSP - Servlet related question - Request Help

Discussion in 'Java' started by Daku, Mar 23, 2010.

  1. Daku

    Daku Guest

    Could some Java guru please help ? I have a JSP, which calls a
    Servlet, which in turn does some database queries, and then generates
    a
    Web page, in its 'doGet' method, and displays the retreived data. The
    retreived data is displayed as a set of checkboxes with suitable
    labels and all. By seelcting appropriate checkboxes, and clicking on a
    button, the user
    adds the selected item to another list. I was
    wondering if there is a way to achieve the same something like the
    following - the user simply passes the mouse over the items he/she
    wants (no checking of checkboxes) and the items get selected. Any
    hints, suggestions would be of immense value. Thanks in advance fro
    your help.
    Daku, Mar 23, 2010
    #1
    1. Advertising

  2. Daku

    Fingolfin Guest

    On 23.3.2010. 6:59, Daku wrote:
    > Could some Java guru please help ? I have a JSP, which calls a
    > Servlet, which in turn does some database queries, and then generates
    > a
    > Web page, in its 'doGet' method, and displays the retreived data. The
    > retreived data is displayed as a set of checkboxes with suitable
    > labels and all. By seelcting appropriate checkboxes, and clicking on a
    > button, the user
    > adds the selected item to another list. I was
    > wondering if there is a way to achieve the same something like the
    > following - the user simply passes the mouse over the items he/she
    > wants (no checking of checkboxes) and the items get selected. Any
    > hints, suggestions would be of immense value. Thanks in advance fro
    > your help.


    There are several methods checking checkboxes with JavaScript, here is one:

    <p>Please select a sport that you like to play.</p>
    Soccer: <input type="checkbox" name="sports" value="soccer"
    onMouseover="if (!this.checked) { this.checked = true; } else {
    this.checked = false; }" /><br />
    Football: <input type="checkbox" name="sports" value="football"
    onMouseover="if (!this.checked) { this.checked = true; } else {
    this.checked = false; }" /><br />

    You could put checking/unchecking in a separate function also, for that
    instead of "this.checked = true;" you should place a function call that
    passes a checkbox number and the function would be something like:
    "form.sports[checkBox].checked=true".

    But nevermind that, if you want to write the changes in the database as
    you hover your mouse over these checkboxes (without clicking a button) I
    believe you should use Ajax.
    Fingolfin, Mar 23, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. circuit_breaker
    Replies:
    2
    Views:
    1,993
    Jack Jia
    Apr 4, 2004
  2. Replies:
    3
    Views:
    29,091
    Stuart Wood
    Jun 6, 2006
  3. javadev
    Replies:
    5
    Views:
    12,899
    javadev
    Nov 16, 2006
  4. Replies:
    9
    Views:
    721
  5. Replies:
    4
    Views:
    777
Loading...

Share This Page