Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Select tag  RSS feed

 
vicneswaran boi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

I have a problem in selection.meaning that whenever i select a topic from a dropdown list, i want all those details related to that topic to be retrieved from my database and not eveything. i tried using the below but it seem give me the same topic for instance "ARTS" each time around.I dont know wheater it is a problem with my sql statement or the select statement in the drop down list.

Sql statement--
ResultSet columns = statement.executeQuery("SELECT * FROM Member WHERE D LIKE 'ARTS'");


Select statement--
<select name="section" size="1" language="javascript" onChange="gotoPage(this.selectedIndex);">
<option>ARTS</option>
<option>Soccer</option>
<option>Public Relations</option>
</select></p>
</form>
</form>
<String A = session.getParameter("section");>
<script language="JavaScript">
<!--
function gotoPage(varItem)
{
switch(varItem)
{
case 0:
I1.location="http://127.0.0.1:8080/examples/jsp/myjsp/TECC/View3.jsp";
break;
case 1:
I1.location="http://127.0.0.1:8080/examples/jsp/myjsp/TECC/View3.jsp";
break;
case 2:
I1.location="http://127.0.0.1:8080/examples/jsp/myjsp/TECC/View3.jsp";
break;

}
}
// -->
</script>
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- use = sign to match the string if it is exactly the same in the DB. dont use like operator

- like alone is not a operator use "is like"

- where are you using String A after getting it from session.getParameter("section")

- if your attribute does not qualify the session scope. don't put it into the session.

- couldn't understand your session.getParameter("section"), where are you setting this to session. and according to my knowledge we dont have any methods like getParameter(String) and setParameter(String, Object)in HttpSession class. is there any??

it may help you
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!