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
Suggestions on Architecture for New Application
Run the first php script in background - When done - run the next script ...
SQLCommandBuilder - GetUpdateCommand, GetInsertCommand and GetDeleteCommand Questions
Best way to find out what a user has access to on a file server
Mail delivery has failed
Clear only first 5 columns
Airport Code with reverse geo coding with google maps api
Outlook 2007 freezes forwarding email
Cannot access Windows 2008 DFS links from Windows 2003
How to get lightbox to show over Flash banner?