Showing posts with label radiobuttonlist. Show all posts
Showing posts with label radiobuttonlist. Show all posts

Thursday, March 29, 2012

set column distances for RadioButtonList

Hello,
I have a radioButtonList and set RepeatColumns to 2.
However, the distance between radiobutton in column1 and radiobutton
in column2 is too close.
Can someone how to set the distance (either with CSS or not)?
Many Thanks
JerryHave you tried using cellspacing for the radiobuttonlist?
I mean something like
<asp:RadioButtonList ID="RadioBtnList" runat="server" RepeatColumns="2"
CellSpacing="10">
<asp:ListItem>Item 1</asp:ListItem>
<asp:ListItem>Item 2</asp:ListItem>
<asp:ListItem>Item 3</asp:ListItem>
<asp:ListItem>Item 4</asp:ListItem>
<asp:ListItem>Item 5</asp:ListItem>
<asp:ListItem>Item 6</asp:ListItem>
</asp:RadioButtonList>
--
>From: DAXU@.hotmail.com
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Subject: set column distances for RadioButtonList
>Date: Tue, 4 Dec 2007 08:23:18 -0800 (PST)
>Organization: http://groups.google.com
>Lines: 11
>Message-ID:
<5b0fa9e7-9fe6-4fca-8150-56abb4a67d6e@.f3g2000hsg.googlegroups.com>
>NNTP-Posting-Host: 80.5.93.39
>Mime-Version: 1.0
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 7bit
>X-Trace: posting.google.com 1196785399 22323 127.0.0.1 (4 Dec 2007
16:23:19 GMT)
>X-Complaints-To: groups-abuse@.google.com
>NNTP-Posting-Date: Tue, 4 Dec 2007 16:23:19 +0000 (UTC)
>Complaints-To: groups-abuse@.google.com
>Injection-Info: f3g2000hsg.googlegroups.com; posting-host=80.5.93.39;
> posting-account=a-mEAAoAAABlXzZHzkVMW2qA_BbvR8Hj
>User-Agent: G2/1.0
>X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US;
rv:1.8.1.11)
> Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe)
>Content-Disposition: inline
>Path:
TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTFEEDS02.phx.gbl!newsfeed0
0.sul.t-online.de!t-online.de!news.glorb.com!postnews.google.com!f3g2000hsg.
googlegroups.com!not-for-mail
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.dotnet.framework.aspnet:52366
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Hello,
>I have a radioButtonList and set RepeatColumns to 2.
>However, the distance between radiobutton in column1 and radiobutton
>in column2 is too close.
>Can someone how to set the distance (either with CSS or not)?
>Many Thanks
>Jerry
>
Thank You,
Nanda Lella,
This Posting is provided "AS IS" with no warranties, and confers no rights.

Thursday, March 22, 2012

set ID of control dynamicaly

I tried to set the ID of a radiobuttonlist dynamicaly like this:
<asp:RadioButtonList id="<%# DataBinder.Eval(Container.DataItem,
"optionnameFR") %>" runat="server" ></asp:RadioButtonList>
(fyi: the radiobuttonlist-control is placed in a datalist.)
But I get this error:
'<%# DataBinder.Eval(Container.DataItem, "optionnameFR") %>' is not a valid
identifier
Any help is appreciated,
Nic.We've gotten this question a lot the last couple ws. This is a timing
issue, controls are created before they are databound...in order to create
the control, it needs an id. In other words, you can't really do what you
want to. On the flip side, there's a much better way anyways.
Two things, if you HAVE to create the id dynamically (read on though, cuz
you don't) you can always create the radiobuttonlist dynamically on the
ItemDataBound event. Something like:
sub repeater_ItemDataBound(s as object, e as RepeaterItemEventArgs)
if e.item.ItemType = ListItemType.Item then
dim rad as new RadioButtonList
rad.id = ctype(e.item.DataItem, DataRowView)("optionnameFR")
e.item.Controls.Add(rad)
end if
end sub
The above code might not work exactly as is, but should give you an
idea...
The real question you should be asking is if this is necessary? Chances are
that you can assign the radiobuttonlist a static id, say "optionNameFr" and
then access it, in the ITemDataBound or when a button is saved via
e.item.FindControl("optionNameFr")
check out my databinding tutorial for some more ideas:
http://openmymind.net/databinding/index.html
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"nicholas" <murmurait1@.hotmail.com> wrote in message
news:%23p0Whvv0EHA.2040@.tk2msftngp13.phx.gbl...
> I tried to set the ID of a radiobuttonlist dynamicaly like this:
> <asp:RadioButtonList id="<%# DataBinder.Eval(Container.DataItem,
> "optionnameFR") %>" runat="server" ></asp:RadioButtonList>
> (fyi: the radiobuttonlist-control is placed in a datalist.)
> But I get this error:
> '<%# DataBinder.Eval(Container.DataItem, "optionnameFR") %>' is not a
valid
> identifier
> Any help is appreciated,
> Nic.
>
thx a lot for your reply
You're indeed right.
had a look a your link: it's great - real good explanations
THX again
"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%23ThLx%23v0EHA.2012@.TK2MSFTNGP15.phx.gbl...
> We've gotten this question a lot the last couple ws. This is a timing
> issue, controls are created before they are databound...in order to create
> the control, it needs an id. In other words, you can't really do what you
> want to. On the flip side, there's a much better way anyways.
> Two things, if you HAVE to create the id dynamically (read on though, cuz
> you don't) you can always create the radiobuttonlist dynamically on the
> ItemDataBound event. Something like:
> sub repeater_ItemDataBound(s as object, e as RepeaterItemEventArgs)
> if e.item.ItemType = ListItemType.Item then
> dim rad as new RadioButtonList
> rad.id = ctype(e.item.DataItem, DataRowView)("optionnameFR")
> e.item.Controls.Add(rad)
> end if
> end sub
>
> The above code might not work exactly as is, but should give you an
> idea...
> The real question you should be asking is if this is necessary? Chances
are
> that you can assign the radiobuttonlist a static id, say "optionNameFr"
and
> then access it, in the ITemDataBound or when a button is saved via
> e.item.FindControl("optionNameFr")
> check out my databinding tutorial for some more ideas:
> http://openmymind.net/databinding/index.html
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "nicholas" <murmurait1@.hotmail.com> wrote in message
> news:%23p0Whvv0EHA.2040@.tk2msftngp13.phx.gbl...
> valid
>
Maybe I'll explain what I want to do, as I'm a bit on how to do
it...
It's quite a common problem:
I got a product with product options, such as color, size, etc
All are defined a table.
1 table for the products
1 for the options (optionID, parentoptionID, optionname)
ex:
1, 0, color
2, 1, yellow
3, 1, green
4, 1, blue
5, 0, size
6, 5, small
7, 5, medium
8, 5, large
I want an webpage that generates the product info (that's no problem)
and that generates a way of selecting the options.
So, a dynamically created dropdown would be great, but it could also be done
with a dynamically created radiobuttonlist.
I tried to put a radiobuttonlist in a repeater, but the first problem I meet
is that a control in another control can not be found on the page...
Well, anyway. I think I can work it out, but if you have any hints or links
where it allready is explained, it would be even better.
That's it,
Thanks a lot,
Nic
"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%23ThLx%23v0EHA.2012@.TK2MSFTNGP15.phx.gbl...
> We've gotten this question a lot the last couple ws. This is a timing
> issue, controls are created before they are databound...in order to create
> the control, it needs an id. In other words, you can't really do what you
> want to. On the flip side, there's a much better way anyways.
> Two things, if you HAVE to create the id dynamically (read on though, cuz
> you don't) you can always create the radiobuttonlist dynamically on the
> ItemDataBound event. Something like:
> sub repeater_ItemDataBound(s as object, e as RepeaterItemEventArgs)
> if e.item.ItemType = ListItemType.Item then
> dim rad as new RadioButtonList
> rad.id = ctype(e.item.DataItem, DataRowView)("optionnameFR")
> e.item.Controls.Add(rad)
> end if
> end sub
>
> The above code might not work exactly as is, but should give you an
> idea...
> The real question you should be asking is if this is necessary? Chances
are
> that you can assign the radiobuttonlist a static id, say "optionNameFr"
and
> then access it, in the ITemDataBound or when a button is saved via
> e.item.FindControl("optionNameFr")
> check out my databinding tutorial for some more ideas:
> http://openmymind.net/databinding/index.html
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "nicholas" <murmurait1@.hotmail.com> wrote in message
> news:%23p0Whvv0EHA.2040@.tk2msftngp13.phx.gbl...
> valid
>
I created a new toppic for this.
THX
"nicholas" <murmurait1@.hotmail.com> wrote in message
news:OiRYdaw0EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Maybe I'll explain what I want to do, as I'm a bit on how to do
> it...
> It's quite a common problem:
> I got a product with product options, such as color, size, etc
> All are defined a table.
> 1 table for the products
> 1 for the options (optionID, parentoptionID, optionname)
> ex:
> 1, 0, color
> 2, 1, yellow
> 3, 1, green
> 4, 1, blue
> 5, 0, size
> 6, 5, small
> 7, 5, medium
> 8, 5, large
> I want an webpage that generates the product info (that's no problem)
> and that generates a way of selecting the options.
> So, a dynamically created dropdown would be great, but it could also be
done
> with a dynamically created radiobuttonlist.
> I tried to put a radiobuttonlist in a repeater, but the first problem I
meet
> is that a control in another control can not be found on the page...
> Well, anyway. I think I can work it out, but if you have any hints or
links
> where it allready is explained, it would be even better.
> That's it,
> Thanks a lot,
> Nic
> "Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
> wrote in message news:%23ThLx%23v0EHA.2012@.TK2MSFTNGP15.phx.gbl...
timing
create
you
cuz
> are
> and
>

set ID of control dynamicaly

I tried to set the ID of a radiobuttonlist dynamicaly like this:

<asp:RadioButtonList id="<%# DataBinder.Eval(Container.DataItem,
"optionnameFR") %>" runat="server" ></asp:RadioButtonList
(fyi: the radiobuttonlist-control is placed in a datalist.)

But I get this error:
'<%# DataBinder.Eval(Container.DataItem, "optionnameFR") %>' is not a valid
identifier

Any help is appreciated,
Nic.We've gotten this question a lot the last couple weeks. This is a timing
issue, controls are created before they are databound...in order to create
the control, it needs an id. In other words, you can't really do what you
want to. On the flip side, there's a much better way anyways.

Two things, if you HAVE to create the id dynamically (read on though, cuz
you don't) you can always create the radiobuttonlist dynamically on the
ItemDataBound event. Something like:

sub repeater_ItemDataBound(s as object, e as RepeaterItemEventArgs)
if e.item.ItemType = ListItemType.Item then
dim rad as new RadioButtonList
rad.id = ctype(e.item.DataItem, DataRowView)("optionnameFR")
e.item.Controls.Add(rad)
end if
end sub

The above code might not work exactly as is, but should give you an
idea...

The real question you should be asking is if this is necessary? Chances are
that you can assign the radiobuttonlist a static id, say "optionNameFr" and
then access it, in the ITemDataBound or when a button is saved via
e.item.FindControl("optionNameFr")

check out my databinding tutorial for some more ideas:
http://openmymind.net/databinding/index.html

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"nicholas" <murmurait1@.hotmail.com> wrote in message
news:%23p0Whvv0EHA.2040@.tk2msftngp13.phx.gbl...
> I tried to set the ID of a radiobuttonlist dynamicaly like this:
> <asp:RadioButtonList id="<%# DataBinder.Eval(Container.DataItem,
> "optionnameFR") %>" runat="server" ></asp:RadioButtonList>
> (fyi: the radiobuttonlist-control is placed in a datalist.)
> But I get this error:
> '<%# DataBinder.Eval(Container.DataItem, "optionnameFR") %>' is not a
valid
> identifier
> Any help is appreciated,
> Nic.
thx a lot for your reply
You're indeed right.

had a look a your link: it's great - real good explanations

THX again

"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%23ThLx%23v0EHA.2012@.TK2MSFTNGP15.phx.gbl...
> We've gotten this question a lot the last couple weeks. This is a timing
> issue, controls are created before they are databound...in order to create
> the control, it needs an id. In other words, you can't really do what you
> want to. On the flip side, there's a much better way anyways.
> Two things, if you HAVE to create the id dynamically (read on though, cuz
> you don't) you can always create the radiobuttonlist dynamically on the
> ItemDataBound event. Something like:
> sub repeater_ItemDataBound(s as object, e as RepeaterItemEventArgs)
> if e.item.ItemType = ListItemType.Item then
> dim rad as new RadioButtonList
> rad.id = ctype(e.item.DataItem, DataRowView)("optionnameFR")
> e.item.Controls.Add(rad)
> end if
> end sub
>
> The above code might not work exactly as is, but should give you an
> idea...
> The real question you should be asking is if this is necessary? Chances
are
> that you can assign the radiobuttonlist a static id, say "optionNameFr"
and
> then access it, in the ITemDataBound or when a button is saved via
> e.item.FindControl("optionNameFr")
> check out my databinding tutorial for some more ideas:
> http://openmymind.net/databinding/index.html
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "nicholas" <murmurait1@.hotmail.com> wrote in message
> news:%23p0Whvv0EHA.2040@.tk2msftngp13.phx.gbl...
> > I tried to set the ID of a radiobuttonlist dynamicaly like this:
> > <asp:RadioButtonList id="<%# DataBinder.Eval(Container.DataItem,
> > "optionnameFR") %>" runat="server" ></asp:RadioButtonList>
> > (fyi: the radiobuttonlist-control is placed in a datalist.)
> > But I get this error:
> > '<%# DataBinder.Eval(Container.DataItem, "optionnameFR") %>' is not a
> valid
> > identifier
> > Any help is appreciated,
> > Nic.
Maybe I'll explain what I want to do, as I'm a bit confused on how to do
it...

It's quite a common problem:

I got a product with product options, such as color, size, etc
All are defined a table.
1 table for the products
1 for the options (optionID, parentoptionID, optionname)
ex:
1, 0, color
2, 1, yellow
3, 1, green
4, 1, blue
5, 0, size
6, 5, small
7, 5, medium
8, 5, large

I want an webpage that generates the product info (that's no problem)
and that generates a way of selecting the options.

So, a dynamically created dropdown would be great, but it could also be done
with a dynamically created radiobuttonlist.

I tried to put a radiobuttonlist in a repeater, but the first problem I meet
is that a control in another control can not be found on the page...

Well, anyway. I think I can work it out, but if you have any hints or links
where it allready is explained, it would be even better.

That's it,

Thanks a lot,
Nic

"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%23ThLx%23v0EHA.2012@.TK2MSFTNGP15.phx.gbl...
> We've gotten this question a lot the last couple weeks. This is a timing
> issue, controls are created before they are databound...in order to create
> the control, it needs an id. In other words, you can't really do what you
> want to. On the flip side, there's a much better way anyways.
> Two things, if you HAVE to create the id dynamically (read on though, cuz
> you don't) you can always create the radiobuttonlist dynamically on the
> ItemDataBound event. Something like:
> sub repeater_ItemDataBound(s as object, e as RepeaterItemEventArgs)
> if e.item.ItemType = ListItemType.Item then
> dim rad as new RadioButtonList
> rad.id = ctype(e.item.DataItem, DataRowView)("optionnameFR")
> e.item.Controls.Add(rad)
> end if
> end sub
>
> The above code might not work exactly as is, but should give you an
> idea...
> The real question you should be asking is if this is necessary? Chances
are
> that you can assign the radiobuttonlist a static id, say "optionNameFr"
and
> then access it, in the ITemDataBound or when a button is saved via
> e.item.FindControl("optionNameFr")
> check out my databinding tutorial for some more ideas:
> http://openmymind.net/databinding/index.html
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "nicholas" <murmurait1@.hotmail.com> wrote in message
> news:%23p0Whvv0EHA.2040@.tk2msftngp13.phx.gbl...
> > I tried to set the ID of a radiobuttonlist dynamicaly like this:
> > <asp:RadioButtonList id="<%# DataBinder.Eval(Container.DataItem,
> > "optionnameFR") %>" runat="server" ></asp:RadioButtonList>
> > (fyi: the radiobuttonlist-control is placed in a datalist.)
> > But I get this error:
> > '<%# DataBinder.Eval(Container.DataItem, "optionnameFR") %>' is not a
> valid
> > identifier
> > Any help is appreciated,
> > Nic.
I created a new toppic for this.
THX

"nicholas" <murmurait1@.hotmail.com> wrote in message
news:OiRYdaw0EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Maybe I'll explain what I want to do, as I'm a bit confused on how to do
> it...
> It's quite a common problem:
> I got a product with product options, such as color, size, etc
> All are defined a table.
> 1 table for the products
> 1 for the options (optionID, parentoptionID, optionname)
> ex:
> 1, 0, color
> 2, 1, yellow
> 3, 1, green
> 4, 1, blue
> 5, 0, size
> 6, 5, small
> 7, 5, medium
> 8, 5, large
> I want an webpage that generates the product info (that's no problem)
> and that generates a way of selecting the options.
> So, a dynamically created dropdown would be great, but it could also be
done
> with a dynamically created radiobuttonlist.
> I tried to put a radiobuttonlist in a repeater, but the first problem I
meet
> is that a control in another control can not be found on the page...
> Well, anyway. I think I can work it out, but if you have any hints or
links
> where it allready is explained, it would be even better.
> That's it,
> Thanks a lot,
> Nic
> "Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
> wrote in message news:%23ThLx%23v0EHA.2012@.TK2MSFTNGP15.phx.gbl...
> > We've gotten this question a lot the last couple weeks. This is a
timing
> > issue, controls are created before they are databound...in order to
create
> > the control, it needs an id. In other words, you can't really do what
you
> > want to. On the flip side, there's a much better way anyways.
> > Two things, if you HAVE to create the id dynamically (read on though,
cuz
> > you don't) you can always create the radiobuttonlist dynamically on the
> > ItemDataBound event. Something like:
> > sub repeater_ItemDataBound(s as object, e as RepeaterItemEventArgs)
> > if e.item.ItemType = ListItemType.Item then
> > dim rad as new RadioButtonList
> > rad.id = ctype(e.item.DataItem, DataRowView)("optionnameFR")
> > e.item.Controls.Add(rad)
> > end if
> > end sub
> > The above code might not work exactly as is, but should give you an
> > idea...
> > The real question you should be asking is if this is necessary? Chances
> are
> > that you can assign the radiobuttonlist a static id, say "optionNameFr"
> and
> > then access it, in the ITemDataBound or when a button is saved via
> > e.item.FindControl("optionNameFr")
> > check out my databinding tutorial for some more ideas:
> > http://openmymind.net/databinding/index.html
> > Karl
> > --
> > MY ASP.Net tutorials
> > http://www.openmymind.net/
> > "nicholas" <murmurait1@.hotmail.com> wrote in message
> > news:%23p0Whvv0EHA.2040@.tk2msftngp13.phx.gbl...
> > > I tried to set the ID of a radiobuttonlist dynamicaly like this:
> > > > <asp:RadioButtonList id="<%# DataBinder.Eval(Container.DataItem,
> > > "optionnameFR") %>" runat="server" ></asp:RadioButtonList>
> > > > (fyi: the radiobuttonlist-control is placed in a datalist.)
> > > > But I get this error:
> > > '<%# DataBinder.Eval(Container.DataItem, "optionnameFR") %>' is not a
> > valid
> > > identifier
> > > > Any help is appreciated,
> > > Nic.
> >

Tuesday, March 13, 2012

Set Radiobuttonlist Value via Javascript

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 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
>>
>>
>>

Set Radiobuttonlist Value via Javascript

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 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...
> it.
> screen,
> rblSendCard,
> empty
> it
>