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
visual studio 2010 not automatically rebuild
Set Up ETags - IIS 6
Can't open to a specified PDF page in IE 8
Visual Studio Client-side Reporting Spaces in your text formatting
Domain admins for local machines
Your message was read on Monday, Month Day Year
How to create a self signed certificate on windows XP
Windows NT4 High Encryption Pack
MS Access 2007 Login Form
Help! Terminal Server printing