search using JSP

Hello,

I have a combo box within which i have given 2 options namely select by faculty name and other one select by department. Next to the combo box is a text field where the admin will enter the name of the faculty or the department.

What i want is to execute a query based on the option is selected.

I have used <select> forcombo box.

Please suggest how can i do the above said .

Thanx in advance,

Mudit

[458 byte] By [muditvaidyaa] at [2007-11-27 9:41:31]
# 1

What's the big deal? Based on the selection and the text entered in the text box, write a query in your business logic.

I hope you have aciton form, that will have your selected combo box value and text box value.

SELECT * FROM TABLE_NAME WHERE FACULTY_NAME='input_string';

or

SELECT * FROM TABLE_NAME WHERE DEPARTMENT='input_string';

The method contains this query should return a collection.

skp71a at 2007-7-12 23:20:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
the problem is that i am unable to write a query based on the text entered in the text field in java.The text field's name is choice.using choice.value i get the text that is entered in the field but cannot use that in java code within <% %>
muditvaidyaa at 2007-7-12 23:20:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
It sounds like that you're confusing the clientside Javascript with serverside JSP and trying to mix them both.Don't do that. JavaScript != Java.
BalusCa at 2007-7-12 23:20:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...