I have two combo boxes. The value of the second is defaulted based on the value of the first. I am using JavaScript to call an AJAX web service and to update the second combo box.
Here is part of my source code in C#:
In IE7, when I select a value from the first ComboBox (RadComboBoxExistingLuminaire), it properly updates the value of the second ComboBox (RadComboBoxTCPLuminaire) and also updates a couple of labels in the User Control. The second combo box is set based on the value of the first. Sort of a recommended replacement function.
It also properly saves the data via the AJAX call to the database. No problem.
However, in FireFox, when I select a value in the first combo box, it properly updates the second combobox and the labels, BUT, once I click off of the first combo box (to move to a text box, for example) or tab to the next control, the first combo resets itself to some random index (and then also causes the second combo box to set itself to a different value).
It's not always reproducable as to which index it will get set to.
To give you the bigger picture of where the RadComboBoxes are, the page has an AjaxControlToolkit TabPanelContainer control on it (this was developed before we started using Telerik controls) and within the container, is the TabPanel that this is on. In that TabPanel is a repeater, and the elements of the repeater are a user control and the user control contains the combo boxes.
It appears to be working fine in IE7 (and Safari), but not in FireFox.
Here is part of my source code in C#:
| StringBuilder javaScript = new StringBuilder(); |
| javaScript.Append("saveLuminaireInvestment("); |
| javaScript.Append("$get('" + this.lblLuminaireID.ClientID + "').innerHTML, "); |
| javaScript.Append("$find('" + this.RadComboBoxExistingLuminaire.ClientID + "').get_value(), "); |
| javaScript.Append("$find('" + this.RadComboBoxTCPLuminaire.ClientID + "').get_value(), "); |
| javaScript.Append("$get('" + this.txtQuantity.ClientID + "').value, "); |
| javaScript.Append("$get('" + this.txtTCPQuantity.ClientID + "').value, "); |
| javaScript.Append("$get('" + this.txtTCPCostPerFixture.ClientID + "').value, "); |
| javaScript.Append("$get('" + this.txtTCPInstallCost.ClientID + "').value, "); |
| javaScript.Append("$get('" + this.txtTCPRebate.ClientID + "').value"); |
| javaScript.Append("); "); |
| StringBuilder javaScript2 = new StringBuilder(); |
| javaScript2.Append("LinearCalcWS.getTCPFixtureEquiv($find('" + RadComboBoxExistingLuminaire.ClientID + "').get_value(), function(result) { if (result != null) { "); |
| javaScript2.Append("$find('" + this.RadComboBoxTCPLuminaire.ClientID + "').findItemByValue(result.TCPFixtureID).select(); "); |
| javaScript2.Append("$get('" + this.lblExistFixtureDesc.ClientID + "').innerHTML = result.ExistingFixtureDescription; "); |
| javaScript2.Append("$get('" + this.lblTCPFixtureDesc.ClientID + "').innerHTML = result.TCPFixtureDescription; "); |
| javaScript2.Append(javaScript.ToString()); |
| javaScript2.Append("} });"); |
| StringBuilder javaScript3 = new StringBuilder(); |
| javaScript3.Append("LinearCalcWS.getTCPFixtureDescription($find('" + RadComboBoxTCPLuminaire.ClientID + "').get_value(), function(result) { if (result != null) { "); |
| javaScript3.Append("$get('" + this.lblTCPFixtureDesc.ClientID + "').innerHTML = result; "); |
| javaScript3.Append(javaScript.ToString()); |
| javaScript3.Append("} });"); |
| RadComboBoxExistingLuminaire.OnClientSelectedIndexChanged = "function() {" + javaScript2.ToString() + "}"; |
| RadComboBoxTCPLuminaire.OnClientSelectedIndexChanged = "function() {" + javaScript3.ToString() + "}"; |
In IE7, when I select a value from the first ComboBox (RadComboBoxExistingLuminaire), it properly updates the value of the second ComboBox (RadComboBoxTCPLuminaire) and also updates a couple of labels in the User Control. The second combo box is set based on the value of the first. Sort of a recommended replacement function.
It also properly saves the data via the AJAX call to the database. No problem.
However, in FireFox, when I select a value in the first combo box, it properly updates the second combobox and the labels, BUT, once I click off of the first combo box (to move to a text box, for example) or tab to the next control, the first combo resets itself to some random index (and then also causes the second combo box to set itself to a different value).
It's not always reproducable as to which index it will get set to.
To give you the bigger picture of where the RadComboBoxes are, the page has an AjaxControlToolkit TabPanelContainer control on it (this was developed before we started using Telerik controls) and within the container, is the TabPanel that this is on. In that TabPanel is a repeater, and the elements of the repeater are a user control and the user control contains the combo boxes.
It appears to be working fine in IE7 (and Safari), but not in FireFox.