• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dependent Combo Box

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,

In my project, I need a depenedent combo box, I have got some inputs from some websites and i designed like this. The codes are given below





MySQL database details are here



The values are populating well and fine. In the code I have created arraylist in test2.jsp and is sending to country.jsp file. When it comes to country.jsp the values looks like this, when I select Kenya in the country.



Again when I, split it into two different arrays, i will get in first array
[001] and in second [Mombassa]

When I populate the value in the second combo box, I am getting the square brackets also.

Please help me to avoid the brackets.

Thanks in advance

Regards

Aravind Prasad
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are the square brackets coming from? Database?

Eric
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not coming from the database, When we check the out.println of the Array list it is coming with that.

Please try to check this program, I provided and check it out.

Thanks/Regards
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,

I have removed the square brackets using substring and it is now working perfectly

Thank you for the help and support.

Regards

Aravind Prasad
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Terminology correction: there is no such thing as a "combo box" on the web. Please read this for more information.
 
Sanjeev P Kulkarni
Greenhorn
Posts: 20
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for sharing this code. This code is truly a worth sharing here as I have searched a lot for this code. Can you please tell me how to remove those square brackets? As I am also trying to use your code, but couldn't figure out how to remove them. Please help me thanks.

Aravind Prasad wrote:Dear Ranchers,

I have removed the square brackets using substring and it is now working perfectly

Thank you for the help and support.

Regards

Aravind Prasad
 
subhash kumar
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanjeev Pk wrote:Thanks a lot for sharing this code. This code is truly a worth sharing here as I have searched a lot for this code. Can you please tell me how to remove those square brackets? As I am also trying to use your code, but couldn't figure out how to remove them. Please help me thanks.

Aravind Prasad wrote:Dear Ranchers,

I have removed the square brackets using substring and it is now working perfectly

Thank you for the help and support.

Regards

Aravind Prasad


sanjeev have done something like


so add your list to response by removing the brackets by substring method
 
Sanjeev P Kulkarni
Greenhorn
Posts: 20
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
subhash kumar wrote:
Sanjeev Pk wrote:Thanks a lot for sharing this code. This code is truly a worth sharing here as I have searched a lot for this code. Can you please tell me how to remove those square brackets? As I am also trying to use your code, but couldn't figure out how to remove them. Please help me thanks.

Aravind Prasad wrote:Dear Ranchers,

I have removed the square brackets using substring and it is now working perfectly

Thank you for the help and support.

Regards

Aravind Prasad


sanjeev have done something like


so add your list to response by removing the brackets by substring method


Thanks a million Sir. This code is one of the valuable and most widely used. Thank you once again for helping me...
 
Sanjeev P Kulkarni
Greenhorn
Posts: 20
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanjeev P Kulkarni wrote:
subhash kumar wrote:
Sanjeev Pk wrote:Thanks a lot for sharing this code. This code is truly a worth sharing here as I have searched a lot for this code. Can you please tell me how to remove those square brackets? As I am also trying to use your code, but couldn't figure out how to remove them. Please help me thanks.

Aravind Prasad wrote:Dear Ranchers,

I have removed the square brackets using substring and it is now working perfectly

Thank you for the help and support.

Regards

Aravind Prasad


sanjeev have done something like


so add your list to response by removing the brackets by substring method


Thanks a million Sir. This code is one of the valuable and most widely used. Thank you once again for helping me...


Just a small doubt, How to get the value of a port selected in your country.jsp??? because I need to save both the combo box values into the database. I tried document.form.state.value also tried printing document.frmVal.stateId.options.add(optn); but nothing is working out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic