Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to insert textbox values from choosing radiobutton list items.suppose i have 3 textbox, i want to select 1 of them from radiobutton list items and insert its value into sql.plz help me.
Posted
Comments
[no name] 10-Aug-12 9:05am    
To get help you first have to come up with a problem. You have not described any kind of a problem nor have you posted any code that demonstrates the problem you are having. If you want to do what you decribe you want to do then do it. There is absolutely nothing stopping you.
StianSandberg 10-Aug-12 9:07am    
What have you tried?
Sergey Alexandrovich Kryukov 10-Aug-12 15:54pm    
No a question. Help with what? If you need my approval, you got it: go ahead and insert what you need.
What is your problem? ADO.NET? SQL? Binding?
--SA

1 solution

C#
/ Only allows numeric values
function isNumeric(num){
    var charCode = (num.which) ? num.which : event.keyCode;
    if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false; }
    else { return true; }
}

// Validates TextBox Length
function validateTextBoxLength() {
    var tb = document.getElementById("TextBox1").value;
    if (tb.length > 1 && tb.length != 4) {
        alert("TextBox must be 4 digits.");
        return false;
    }
    return true;
}

// Check for RadioButtonList selection
function rbSelectedValue() {
    var radio = document.getElementsByName('<%= rblSearchType.ClientID %>');
    var tb = document.getElementById("TextBox1").value;
    for (var i = 0; i < radio.length; i++) {
        if (radio[i].checked) {
            // alert("RadioButton 1 Selected");
            if (tb.length > 1 && tb.length != 4) {
                alert("TextBox must be 4 digits.");
                return false;
            }
            else {
            return true;
            }
        }
        else {
        // alert("RadioButton 2 Selected");
        return true;
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900