Get the Selected Radiobutton from Radio Button List in Javascript

by ebarcza 8/20/2010 11:56:00 AM

Just pass in the clientid of the Radio button list control and this function will return the ID of the selected radio button so you can do what you want with it.

function GetRBLSelectionID(RadioButtonListID) {
    var RB1 = document.getElementById(RadioButtonListID);
    var radio = RB1.getElementsByTagName("input");
    var isChecked = false;
    var retVal = "";
    for (var i = 0; i < radio.length; i++) {
        if (radio[i].checked) {
            retVal = radio[i].id;
    return retVal;



Tags: , ,

.NET | JavaScript

Handle Enter key like the Tab key

by jrose 5/7/2010 9:57:00 AM

To allow ease of use for users that aren't accustomed to using the Tab key to switch between HTML elements and would prefer to use the Enter instead, simply add a OnKeyDown event handler to the element that changes a key code of 13 [Enter's value] to 9 [Tab's value].


For example:

<input type="text" onkeydown="if (event.keyCode==13) {event.keyCode=9; return event.keyCode }" id="text1">

<input type="text" id="text2">


After entering text into the text1 element, the user is allowed to press Enter [or Tab] to navigate to the text2 element.

Tags: , , , , , ,


How to access popup parent window elements with JavaScript

by ebarcza 10/8/2009 10:28:00 AM
How to access popup parent window elements with JavaScript

The JavaScript code to access parent windows elements is not a complex one. Indeed, all that is needed is the code window.opener. The rest of the element can be addressed as per usual.

If you wanted to submit a form in the parent window for example, the following code would be used:


As mentioned the code window.opener will access the parent window and document.myForm1 will point to your form (in this case called myForm1) within the document, and then with the function submit(), the information from the form is sent.

Tags: ,


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail


<<  September 2022  >>

View posts in large calendar

Recent comments



The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2022

Sign in