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 BandiRank #1,603 · 981 reputationPosted May 8, 2013, 1:52 AM EDT
Server side code for chkRemit_OnClicked
---------------------------------------------
void chkRemit_OnClicked(Object sender, EventArgs e) { //disable validators when chkRemit is not checked rfvRemitCountry.Enabled = chkRemit.Checked; rfvtxtRmtState.Enabled = chkRemit.Checked; rfv_Remit_Address_Line.Enabled = chkRemit.Checked; //lets say your panel id pnlRemit then show or hide your panel on checkbox checked pnlRemit.Visible = chkRemit.Checked; }Hope this helps
Raj
Raj BandiRank #1,603 · 981 reputationPosted May 4, 2013, 8:03 PM EDT
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
manjula d131 reputationPosted May 7, 2013, 3:07 AM EDT
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(); } }
Bryian TanRank #396 · 6.3K reputationPosted May 7, 2013, 5:28 PM EDT
example:
manjula d131 reputationPosted May 7, 2013, 10:00 PM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jun 5, 2013, 9:32 PM EDT
if you want in client side reply
if solved mark it as answered
Regards,
Sanjeeb