Hi Every one,
this is what I am doing on client side
<telerik:RadCodeBlock runat="server">
<script type="text/javascript">
function OnClientSelectedIndexChanged_Country(sender, eventArgs) {
var item = eventArgs.get_item();
var inputElement = document.getElementById("<%= rpbMainInfo.FindItemByValue("CandidateInformation").FindControl("rtxtState").ClientID %>");
var Combo = document.getElementById("<%= rpbMainInfo.FindItemByValue("CandidateInformation").FindControl("rcbState").ClientID %>");
if (item.get_selectedItem() == "United States") {
Combo.set_visible = true;
inputElement.set_visible = false;
}
else {
Combo.set_visible = false;
inputElement.set_visible = true;
}
}
</script>
</telerik:RadCodeBlock>
<telerik:RadComboBox ID="rcbCountry" runat="server" DataSourceID="sdsCountries" DataTextField="COUNTRY"
DataValueField="COUNTRYCODE" Skin="Outlook" EmptyMessage="Please Select.."
OnClientSelectedIndexChanged="OnClientSelectedIndexChanged_Country">
</telerik:RadComboBox>
What I am trying to do is when the user selects the country as Unitedstates the combo box for states should be visible and when Country other than United states then the states would be a text box.I am able to do this on server side .But I am not able to get on client side .....
CAn we do it on client side or only sever side.
Can Any one help me with this please.
Thanks,
Sravanthi
this is what I am doing on client side
<telerik:RadCodeBlock runat="server">
<script type="text/javascript">
function OnClientSelectedIndexChanged_Country(sender, eventArgs) {
var item = eventArgs.get_item();
var inputElement = document.getElementById("<%= rpbMainInfo.FindItemByValue("CandidateInformation").FindControl("rtxtState").ClientID %>");
var Combo = document.getElementById("<%= rpbMainInfo.FindItemByValue("CandidateInformation").FindControl("rcbState").ClientID %>");
if (item.get_selectedItem() == "United States") {
Combo.set_visible = true;
inputElement.set_visible = false;
}
else {
Combo.set_visible = false;
inputElement.set_visible = true;
}
}
</script>
</telerik:RadCodeBlock>
<telerik:RadComboBox ID="rcbCountry" runat="server" DataSourceID="sdsCountries" DataTextField="COUNTRY"
DataValueField="COUNTRYCODE" Skin="Outlook" EmptyMessage="Please Select.."
OnClientSelectedIndexChanged="OnClientSelectedIndexChanged_Country">
</telerik:RadComboBox>
What I am trying to do is when the user selects the country as Unitedstates the combo box for states should be visible and when Country other than United states then the states would be a text box.I am able to do this on server side .But I am not able to get on client side .....
CAn we do it on client side or only sever side.
Can Any one help me with this please.
Thanks,
Sravanthi