troubleshooting Question

Create a Alert Function for Radio button on asp page

Avatar of kdeutsch
kdeutschFlag for United States of America asked on
JavaScriptScripting Languages
11 Comments3 Solutions386 ViewsLast Modified:
I have to many events going on tis page already, I would like to create a Alert function for when a user only selects the radio button that has a value of 4 and then alerts them to a message.
Still using asp.net 1.1 so I am hoping I can do it on a OnSelectedIndexChanged event on the HTML side of the house.

<td width="30%"><asp:radiobuttonlist id="rbDutyStatus" Runat="server" TextAlign="Right" RepeatLayout="Flow" RepeatDirection="Horizontal" Font-Bold="True" AutoPostBack="True" OnSelectedIndexChanged="javascript:selectRB();">
                                          <asp:ListItem Value="0">VSI&nbsp;&nbsp;</asp:ListItem>
                                          <asp:ListItem Value="1">SI&nbsp;&nbsp;</asp:ListItem>
                                          <asp:ListItem Value="2">NSI&nbsp;&nbsp;</asp:ListItem>
                                          <asp:ListItem Value="3">RTD-L&nbsp;&nbsp;</asp:ListItem>
                                          <asp:ListItem Value="4">RTD&nbsp;&nbsp;</asp:ListItem>
                                    </asp:radiobuttonlist>
Here is the function I created but it does not work.  Very limited knowledge of Javascript.

function selectRB() {
			var rbCount;
			
			if document.frm.rbDutyStatus.checked = "4" then
				Alert("Status Will Change")
						
				}
			}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 3 Answers and 11 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros