views:

501

answers:

1

Hello sir I am new to the jsp and ajax world. my problem is If i select one combo option then it should change the other combo options dynamically without submit button press. for example if i select the country then it should shows their states in other combo. I am using servlet & JSP and MS-ACCESS as backend. please reply as soon as possible.

THANKING YOU....

A: 

You need:

  1. A piece of JSP which returns a string which can be parsed in javascript to create a list of possible combobox items (value, name) to select in the SECOND combobox, based on a VALUE which can be selected in the FIRST combobox
  2. A piece of javascript which receives the onChange event of the FIRST combobox and uses the then selected value to create a XMLHTTP-request to your JSP (at 1)
  3. A piece of javascript which you can pass to the XMLHTTP-request onReadyStateChange event to execute, which reads/parses the parseable string (from 1) and fills the second COMBOBOX with those values

Good luck

Ropstah