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
Export data from a ODBC table
Audit Report Generation SharePoint Content Viewing
Exchange 2010 "RBAC" error in event log
PHP/Javascript newbie - need help integrating niftycube into my site
Looking for vista drivers for Sony pcg-8112l vista laptop
Globally change the Blackberry Service Display name
XP 10 inbound connection limit question
Windows server 2003 terminal users unable to view png images in IE
Porting IP Range when changing ISP
Still having issues pinging from one subnet to another through ASA 5510