Combo Box In Jsp+ Ajax Urgent Please Help Me

Reply

Join Date: Jun 2006
Posts: 1
Reputation: sudhakarsrl is an unknown quantity at this point 
Solved Threads: 0
sudhakarsrl sudhakarsrl is offline Offline
Newbie Poster

Combo Box In Jsp+ Ajax Urgent Please Help Me

 
0
  #1
Jun 28th, 2006
hi respected friends,
i have strucked with out this feature in my project. Please help me,and me sample code if u can .

i have a JSP page which is having two combo boxes,in this page my main aim is:

in my first combo box if i select one courseID ,the next combo box i.e SemesterID need to updated with out page submitting.
I heard that this feature can get by using AJAX and JAVA SCRIPT in JSP.
Here in my data base in course table for example i have 4 course IDs: MTECH
BTECH
MCA
BCA
and
in semester table i have for particular MTECH courseID i have these semesterIDs:sem1
sem2
sem3
sem4

and for MCA courseID i have these semesterIDs:sem1
sem2
sem3
sem3
sem4
sem5
sem6 etc..

here my problem is in my page,in first combo box if i select courseID as: MTECH, in second combobox
i need to get semesterIDs as:sem1,sem2,sem3,sem4.
else if i select courseID as:MCA, in second combo box
i need to get semesterIDs as:sem1,sem2,sem3,sem4,sem5,sem6.


This is the feature i need .
give me sample code for this using AJAX+JAVA SCRIPT in JSP
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 6
Reputation: markenranosa is an unknown quantity at this point 
Solved Threads: 0
markenranosa markenranosa is offline Offline
Newbie Poster

Re: Combo Box In Jsp+ Ajax Urgent Please Help Me

 
0
  #2
Sep 21st, 2006
google it


Ken-Ken
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,326
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 248
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Combo Box In Jsp+ Ajax Urgent Please Help Me

 
0
  #3
Sep 22nd, 2006
If these lists are not too long, you would be better off generting a few hidden tags on your form and use pure JavaScript to pull values from the hidden tags to populate your second list. So say your values lists are as follows:

  1. 1st List Entry Values for second list
  2. AAAAA 11111,22222,33333,44444
  3. BBBBB 11111,33333,66666,77777
  4. CCCCC 55555,66666,88888,99999
then you would create 5 hidden tags with the name AAAAA and each one would contain one of the corresponding values. The same for BBBBB and CCCCC.

Then in java script using an onSelect call, you would then populate the second list using the values "hidden" under the same name as the selected value. As long as the lists are not too large, this would be a very good way to solve your problem.

If you still wish to use AJAX, then I would suggest you find some AJAX tutorial sites and get at least a general idea of how AJAX works and how you program it. Then try to do this, and if you have a any specific questions on how to continue find an AJAX and/or JavaScript forum site to ask these questions.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC