Microsoft
Software
Hardware
Network
Question : Select Input Radio Button on page load from javascript or code behind
Have the following code:
<div class="radiobuttons">
<input id="rPublic" runat="server" type="radio" name="Public" value="Public" onclick="Target('Public');
" />Public
<input id="rPrivate" runat="server" type="radio" name="Private" value="Private" onclick="Target('Private')
;" />Private
</div>
How do I make the Public radio button selected on page load. Either using javascript or in my code behind using vb.net. Thanks.
Answer : Select Input Radio Button on page load from javascript or code behind
Code Behind
rPublic.checked=true
JS:
<script>
var rb = document.getElementById("r
Public");
rb.checked=true;
</script>
HTML:
<input id="rPublic" runat="server" type="radio" name="Public" value="Public" onclick="Target('Public');
" checked />Public
Random Solutions
Sharepoint Webpart page load event issue
AJAX Refresh on Submit of Pop Up Window
HELP! Windows SBS 2008 server keeps hanging URGENT!
Filling a TextBox on a Form with Data from a Field from an SQL Database Table in Visual Studio 2008
GridView control scroll bars are not visible on page reload
How can I convert a custom control that calls User32 and Shell32 to work on Mono?
SBS 2003 / Error: too many hops (delivery attempts: 0)
Excel Date Time format conversion yyyy-mmm-dd hh:mm:ss to mm/dd/yyyy hh:mm:ss
I can send e-mail ok but cannot get to Internet via browser
Conditional Formating in Access