jquery - ASP.NET Radio button value reset after submit form -


i have asp.net app , using jquery toggle enablement of fields. here's rough diagram of ui:

__ checkbox1
o radio1
o radio2
text1
text2

when checkbox1 checked, enable radio1 , radio2. when radio2 selected, enable text1 , text2.

what happening in case after user checks checkbox, , radio buttons enabled, if user selects radio2 , submits form, selection automatically goes radio1.

this problem not occur if don't dynamically enable radio buttons using jquery. wondering if how radio buttons enabled doesn't play nicely how asp.net works radio buttons.

when checkbox value changes, call following helper method in code. since asp.net add around disabled radio button, make sure turn off disabled flag on both span , input.

function setradioenabled(id, enabled) {     var radio = jquery(id);     var parentspan = radio.parent();     if (enabled) {         parentspan.removeattr('disabled');         radio.removeattr('disabled');     } else {         radio.attr('disabled', 'disabled');         parentspan.attr('disabled', 'disabled');     } } 

the radio buttons defined asp:radiobutton tags , share groupname though in different table rows. results in 2 input type=radio instances matching name value.

i confirmed radio being reset page submitted putting breakpoint in postback method , seeing value of radio1.checked true , radio2.checked false. causing page switch value of radio buttons?

thanks in advance, david


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -