One combobox should be update itself based on the value of the first combo box, without repaint.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   manoj_kumar
Posted On:   Saturday, May 1, 2004 05:35 AM

Hi all,


I'm having two combo boxes in my jsp page, whic have some default values.I want to update the second combo box according to the selection of the first combo box.
I don't want to repaint/refresh or use submit button.
The values are comming from oracle database.
I heard that it is possible using XMLHTTP and IFRAME or partial data submission in XML. But i don't have any idea which one and how to uset.
Can anybody help it.


Many Thanx in Advance!

Re: One combobox should be update itself based on the value of the first combo box, without repaint.

Posted By:   Vaishali_Vaggar  
Posted On:   Tuesday, May 18, 2004 02:49 AM

Hi manoj ,

There is a quite simple java script for it.
I think you might have got the solution by now.





function UpdateSample()
{
var makeSelect = document.forms.maintracking.make;
var modelSelect = document.forms.maintracking.map;

modelSelect.options.length = 0; // Clear the popup


if (makeSelect.options[makeSelect.selectedIndex].value == "Country")
{
modelSelect.options[0] = new Option("India");
}

I hope this is quite simple this is the form maintracking
if (makeSelect.options[makeSelect.selectedIndex].value == "State")
{
modelSelect.options[0] = new Option("maharashtra");
modelSelect.options[1] = new Option("karnataka");
modelSelect.options[2] = new Option("punjab");

}
else if (makeSelect.options[makeSelect.selectedIndex].value == "City")
{
modelSelect.options[0] = new Option("chandigarh");
modelSelect.options[1] = new Option("pune");
}
}





the html will be







About | Sitemap | Contact