I have two radiobuttonlist controls on a page. When a user checks 'No' for
rblDeleted, I want to automatically set rblSendCard to 'No' and disable it.
The javascript function I wrote to do this 'appears' to work on the screen,
however, when the page is posted back and I check the value of rblSendCard,
it is an empty string when I expect it to be 'N'.
Of, course I can work around the problem by assuming 'N' when it is an empty
string, but would prefer to have the correct value posted back.
Can anyone tell me how to get it to work the way I expect or explain why it
can't.
Code is below.
TIA
<asp:radiobuttonlist id="rblSendCard" tabIndex="13" runat="server"
RepeatDirection="Horizontal" CellPadding="0"
CellSpacing="0" EnableViewState="False">
<asp:ListItem Value="Y">Yes</asp:ListItem>
<asp:ListItem Value="N">No</asp:ListItem>
</asp:radiobuttonlist>
<asp:radiobuttonlist id="rblDeleted" tabIndex="14" runat="server"
RepeatDirection="Horizontal" EnableViewState="False"
CellPadding="0" CellSpacing="0">
<asp:ListItem Value="Y">Yes</asp:ListItem>
<asp:ListItem Value="N" Selected="True">No</asp:ListItem>
</asp:radiobuttonlist
<script language="JavaScript"> function SetDeleted() {
if(document.getElementById('U_Members1_rblDeleted_ 0').checked){
document.getElementById('U_Members1_rblSendCard_1' ).checked=true;
document.getElementById('U_Members1_rblSendCard'). disabled='disabled';}
else{
document.getElementById('U_Members1_rblSendCard'). disabled='';}}</script
--
Alphonse Giambrone
Email: a-giam at customdatasolutions dot usWhen an html element is disabled, it is not posted in the Request.Forms
Collection.
bill
"Alphonse Giambrone" <NOSPAMa-giam@.example.invalid> wrote in message
news:uZGOHdHMFHA.1948@.TK2MSFTNGP14.phx.gbl...
> Hi all,
> I have two radiobuttonlist controls on a page. When a user checks 'No' for
> rblDeleted, I want to automatically set rblSendCard to 'No' and disable
it.
> The javascript function I wrote to do this 'appears' to work on the
screen,
> however, when the page is posted back and I check the value of
rblSendCard,
> it is an empty string when I expect it to be 'N'.
> Of, course I can work around the problem by assuming 'N' when it is an
empty
> string, but would prefer to have the correct value posted back.
> Can anyone tell me how to get it to work the way I expect or explain why
it
> can't.
> Code is below.
> TIA
> <asp:radiobuttonlist id="rblSendCard" tabIndex="13" runat="server"
> RepeatDirection="Horizontal" CellPadding="0"
> CellSpacing="0" EnableViewState="False">
> <asp:ListItem Value="Y">Yes</asp:ListItem>
> <asp:ListItem Value="N">No</asp:ListItem>
> </asp:radiobuttonlist>
> <asp:radiobuttonlist id="rblDeleted" tabIndex="14" runat="server"
> RepeatDirection="Horizontal" EnableViewState="False"
> CellPadding="0" CellSpacing="0">
> <asp:ListItem Value="Y">Yes</asp:ListItem>
> <asp:ListItem Value="N" Selected="True">No</asp:ListItem>
> </asp:radiobuttonlist>
> <script language="JavaScript"> function SetDeleted() {
> if(document.getElementById('U_Members1_rblDeleted_ 0').checked){
> document.getElementById('U_Members1_rblSendCard_1' ).checked=true;
> document.getElementById('U_Members1_rblSendCard'). disabled='disabled';}
> else{
> document.getElementById('U_Members1_rblSendCard'). disabled='';}}</script>
> --
> Alphonse Giambrone
> Email: a-giam at customdatasolutions dot us
Thanks for the quick reply, Bill.
That certainly explains it.
--
Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"William F. Robertson, Jr." <theman@.nameht.org> wrote in message
news:eONsxwHMFHA.2736@.TK2MSFTNGP09.phx.gbl...
> When an html element is disabled, it is not posted in the Request.Forms
> Collection.
> bill
>
> "Alphonse Giambrone" <NOSPAMa-giam@.example.invalid> wrote in message
> news:uZGOHdHMFHA.1948@.TK2MSFTNGP14.phx.gbl...
>> Hi all,
>>
>> I have two radiobuttonlist controls on a page. When a user checks 'No'
>> for
>> rblDeleted, I want to automatically set rblSendCard to 'No' and disable
> it.
>> The javascript function I wrote to do this 'appears' to work on the
> screen,
>> however, when the page is posted back and I check the value of
> rblSendCard,
>> it is an empty string when I expect it to be 'N'.
>> Of, course I can work around the problem by assuming 'N' when it is an
> empty
>> string, but would prefer to have the correct value posted back.
>>
>> Can anyone tell me how to get it to work the way I expect or explain why
> it
>> can't.
>> Code is below.
>> TIA
>>
>> <asp:radiobuttonlist id="rblSendCard" tabIndex="13" runat="server"
>> RepeatDirection="Horizontal" CellPadding="0"
>> CellSpacing="0" EnableViewState="False">
>> <asp:ListItem Value="Y">Yes</asp:ListItem>
>> <asp:ListItem Value="N">No</asp:ListItem>
>> </asp:radiobuttonlist>
>> <asp:radiobuttonlist id="rblDeleted" tabIndex="14" runat="server"
>> RepeatDirection="Horizontal" EnableViewState="False"
>> CellPadding="0" CellSpacing="0">
>> <asp:ListItem Value="Y">Yes</asp:ListItem>
>> <asp:ListItem Value="N" Selected="True">No</asp:ListItem>
>> </asp:radiobuttonlist>
>>
>> <script language="JavaScript"> function SetDeleted() {
>> if(document.getElementById('U_Members1_rblDeleted_ 0').checked){
>> document.getElementById('U_Members1_rblSendCard_1' ).checked=true;
>> document.getElementById('U_Members1_rblSendCard'). disabled='disabled';}
>> else{
>> document.getElementById('U_Members1_rblSendCard'). disabled='';}}</script>
>>
>> --
>>
>> Alphonse Giambrone
>> Email: a-giam at customdatasolutions dot us
>>
>>
>>
0 comments:
Post a Comment