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
Carrier Unlock for iPhone 3GS iOS 4.0.1 (8A306)
Win 2003 server dns
Teradata Where Clause - Limit date to this month
The future of VBA
iTunes Management
Exchange 2003 to Exchange 2010 Migration
Student Profiles
to check if a download will be spyware free
How to connect Hyper-V Server 2008 R2 to Cluster Shared Volumes
Apache2 name-based virtual host & SSL