JSP - Servlet related question - Request Help

D

Daku

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.
 
F

Fingolfin

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top