Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using the radiobuttonlist in my application, I am setting the "Y" and "N" Values for that radiobuttonlist. I am selecting the "N" values when I click the save button I am getting the value of the radio button list as "Y". I dont know why its happening Like this. Can any help me to solve this problem.

Thanks in Advance
Posted
Comments
Herman<T>.Instance 22-Feb-12 9:19am    
show your code! we can't judge a pragmatic error based on a story in stead of the actual code.

1 solution

Here is the code:

<asp:RadioButtonList ID="rdbChangeRequired" runat="server" CssClass="css_radiobutton_list" RepeatDirection="Horizontal" TabIndex="4" Width="150px">
<asp:ListItem Value="Y" onclick="JavaScript:ChangeRequired_Onclick('Y')">Yes</asp:ListItem>
<asp:ListItem Value="N" Enabled="false" onclick="JavaScript:ChangeRequired_Onclick('N')">No</asp:ListItem></asp:RadioButtonList>

This is the Javascript for that Code It is calling the javascript correctly and the value is coming as "N" in Javascript but in form level the value is coming as "Y":

function ChangeRequired_Onclick(val1) {
if (val1 == 'N') {
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_rdbSalesExecChange_0').disabled = true;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_rdbSalesExecChange_1').disabled = true;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_rdbSalesExecChange_0').checked = false;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_rdbSalesExecChange_1').checked = false;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_btnTCSendForward').disabled = false;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_btnTCReturn').disabled = true;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_btnTCClose').disabled = true;

}
else if (val1 == 'Y') {
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_rdbSalesExecChange_0').disabled = false;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_rdbSalesExecChange_1').disabled = false;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_rdbSalesExecChange_0').checked = true;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_rdbSalesExecChange_1').checked = false;

document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_btnTCSendForward').disabled = true;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_btnTCReturn').disabled = false;
document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_btnTCClose').disabled = true;
// document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_chkTC').nextSibling.innerHTML = "Close for Changes";
// document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_chkTC').checked = true;
// document.getElementById('maincontent_tcBidOwnerValidation_tpTCMapping_chkTC').disabled = true;

}
}

This is the code behind:

 rdbChangeRequired.SelectedValue.ToString().Trim();

Thanks in Advance
 
Share this answer
 
Comments
phil.o 22-Feb-12 10:26am    
Don't post your code as a solution, rather edit your question to include it in there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900