Hello sir,
in my application i have a check box when checked the checkbox panel wil visible with in the panel have a dropdown list control i selected the dropdown list value is zero error msg want to be rise these is my task but my problem is am UN CHECKED the checkbox and button was clicked dropdown validation of error msg has rised pls solve my problem............
Loading
Raj BandiPosted May 8, 2013, 5:52 AM
Server side code for chkRemit_OnClicked
---------------------------------------------
Hope this helps
Raj
Sanjeeb LenkaPosted Jun 6, 2013, 1:32 AM
if you want in client side reply
if solved mark it as answered
Regards,
Sanjeeb
manjula dPosted May 8, 2013, 2:00 AM
Bryian TanPosted May 7, 2013, 9:28 PM
example:
manjula dPosted May 7, 2013, 7:07 AM
code behind is: protected void drp_RemitCountry_TextChanged(object sender, EventArgs e) { if (drp_RemitCountry.Text == "USA") { drpRemitUSAStateList.Visible = true; txtRemitCountry.Visible = false; txtRemitState.Visible = false; drpRemitUSAStateList.SelectedIndex = -1; drpRemitUSAStateList.Focus(); } else if (drp_RemitCountry.Text == "Others") { drpRemitUSAStateList.Visible = false; txtRemitCountry.Visible = true; txtRemitState.Visible = true; txtRemitCountry.Text = ""; txtRemitState.Text = ""; txtRemitCountry.Focus(); } }
Raj BandiPosted May 5, 2013, 12:03 AM
Its too confusing. Can you paste your code here, and explain with control id's.
What my understanding is ( I hope this one server side code)
1) you have a checkbox when checked shows a panel and on uncheck hides a panel
2) inside the panel, you have a drop down list, you have selected an item. then you unchecked checkbox, panel is hidden
3) Button do validation and still drop down list set to some selected, ( not sure what validation is will do?)
If you want to reset drop down selection when checkbox unchecked, set your drop down selected index to -1, or if possible hide it.
if checkbox id is check1, dropdown id is dropdown1 then on check or uncheck
dropdown1.visible = check1.checked. This makes drop down visibility to depend on panel visibility.
other possible way to to is set dropdown causesvalidation to false when checkbox uncheck and to true when checkbox checked
dropdown1.CausesValidation = check1.checked
Hope this helps,
Cheers,
Raj