User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 370,606 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,048 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 6943 | Replies: 2
Reply
Join Date: Jun 2006
Posts: 1
Reputation: sudhakarsrl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sudhakarsrl sudhakarsrl is offline Offline
Newbie Poster

Help Combo Box In Jsp+ Ajax Urgent Please Help Me

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2006
Posts: 6
Reputation: markenranosa is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
markenranosa markenranosa is offline Offline
Newbie Poster

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

  #2  
Sep 21st, 2006
google it


Ken-Ken
Reply With Quote  
Join Date: Feb 2006
Posts: 1,343
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 7
Solved Threads: 111
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

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

  #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:

1st List Entry     Values for second list
AAAAA              11111,22222,33333,44444
BBBBB              11111,33333,66666,77777
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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JSP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 6:36 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC