OnSelecting the radio button how to show a alert message? [Resolved]

Posted by Iluvdotnetfunda under ASP.NET on 3/30/2012 | Points: 10 | Views : 5906 | Status : [Member] | Replies : 6
Hello Friends,
How to show a alert message onclick of Asp:radiobutton.
Kindly help me.
<asp:RadioButtonList ID="rd1" runat="Server" TabIndex="6" RepeatDirection="horizontal" RepeatLayout="Flow">
<asp:ListItem Text="Yes" Value="true" Selected="true" />
<asp:ListItem Text="No" Value="false" />
</asp:RadioButtonList>

for the above code how can i display alert message onclick of radiobutton.
Thanks&Regards
iluvdotnetfunda




Responses

Posted by: Rajni.Shekhar on: 3/30/2012 [Member] Bronze | Points: 50

Up
0
Down

Resolved
check now., i forgot to apply " in last in alert message


check now it is working, i have checked it.

<asp:RadioButtonList ID="rd1" runat="Server" TabIndex="6" RepeatDirection="horizontal" RepeatLayout="Flow" onClick="alert('hi');">
<asp:ListItem Text="Yes" Value="true" Selected="true" />
<asp:ListItem Text="No" Value="false" />
</asp:RadioButtonList>

Thanks,
Rajni Shekhar

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajni.Shekhar on: 3/30/2012 [Member] Bronze | Points: 25

Up
0
Down
try this

<asp:RadioButtonList ID="rd1" runat="Server" TabIndex="6" RepeatDirection="horizontal" RepeatLayout="Flow" onClick="alert('hi');>
<asp:ListItem Text="Yes" Value="true" Selected="true" />
<asp:ListItem Text="No" Value="false" />
</asp:RadioButtonList>


Thanks,
Rajni Shekhar

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Iluvdotnetfunda on: 3/30/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Rajni,

This is not working , i tried it.

Thanks

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Iluvdotnetfunda on: 3/30/2012 [Member] Starter | Points: 25

Up
0
Down
Hello Rajni,

I corrected it and applied, but is not working.
And i tried for this

<asp:RadioButtonList ID="rd1" runat="Server" TabIndex="6" RepeatDirection="horizontal" RepeatLayout="Flow" onclick="alert()">

<asp:ListItem Text="Yes" Value="true" Selected="true" />
<asp:ListItem Text="No" Value="false" />
</asp:RadioButtonList>

And

<script language="javascript" type="text/javascript">

function alert() {
alert("hi");
}
</script>

It is getting the Popup window, but the window is showing "StackOverFlow at the line: ---".

Thanks


Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Iluvdotnetfunda on: 3/30/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Rajni,

Sorry, your code is working fine.

Thanks for your great help.

iluvdotnetfunda

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajni.Shekhar on: 3/30/2012 [Member] Bronze | Points: 25

Up
0
Down
Your welcome. :)

Thanks,
Rajni Shekhar

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response