How to set radio button selected value using jquery

user2636638

How to set radio button selected value in javascript:

HTML Code :

<input type="radio" name="RBLExperienceApplicable" class="radio" value="1" > 
<input type="radio" name="RBLExperienceApplicable" class="radio" value="0" >


<input type="radio" name="RBLExperienceApplicable2" class="radio" value="1" > 
<input type="radio" name="RBLExperienceApplicable2" class="radio" value="0" >

ASPX Code

     <asp:RadioButtonList ID="RBLExperienceApplicable" runat="server" class="radio"    RepeatDirection="Horizontal" EnableViewState="false">
            <asp:ListItem Value="1" Text="Yes &nbsp;&nbsp;"></asp:ListItem> 
                <asp:ListItem Value="0" Text="No"></asp:ListItem>
        </asp:RadioButtonList>

     <asp:RadioButtonList ID="RBLExperienceApplicable2" runat="server" class="radio"  RepeatDirection="Horizontal" EnableViewState="false">
            <asp:ListItem Value="1" Text="Yes &nbsp;&nbsp;"></asp:ListItem> 
                <asp:ListItem Value="0" Text="No"></asp:ListItem>
        </asp:RadioButtonList>

// Some Code Fetch from db
// Based on db value script block will execute

 <script type="text/javascript">
        RadionButtonSelectedValueSet('1');
 </script>

Script Block :

function RadionButtonSelectedValueSet(SelectdValue) {
    $('#RBLExperienceApplicable').val(SelectdValue);
        //$("input[name='RBLExperienceApplicable']:checked").val(SelectdValue);
}
Arun P Johny

Try

function RadionButtonSelectedValueSet(name, SelectdValue) {
    $('input[name="' + name+ '"][value="' + SelectdValue + '"]').prop('checked', true);
}

also call the method on dom ready

<script type="text/javascript">
jQuery(function(){
    RadionButtonSelectedValueSet('RBLExperienceApplicable', '1');
})
</script>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

jquery mobile set selected value of a radio button group

From Dev

If radio button is selected and select value is selected jquery

From Dev

Trying to get value of selected radio button using ajax/jquery

From Dev

How to get the value of a selected radio button and checkbox using its class in jQuery?

From Dev

How to get the NAME and value of a radio button when DYNAMICALLY selected - in jQuery?

From Dev

How to get selected value of list item in radio button list in jquery

From Dev

How to get the NAME and value of a radio button when DYNAMICALLY selected - in jQuery?

From Dev

How to set selected radio button in IONIC using angularJS

From Java

How to get value of selected radio button?

From Dev

How to get value of selected radio button in angularjs

From Dev

How To get Selected Radio Button Value in Mvc

From Dev

How to get the value of the selected radio button?

From Dev

How get value of selected radio button in datalist

From Dev

How to know which radio button is selected in jquery?

From Dev

How can I set the default radio button using jquery

From Dev

How to set checked radio button using name and attr in jquery?

From Dev

How do I check which radio button is selected when there are multiple radio buttons with the same name? (using jquery)

From Dev

How to display a radio button selected using a variable?

From Dev

Jquery for pass selected radio button value on button click

From Dev

Set the class on selected radio button

From Dev

Show the Value of Radio button using Jquery

From Dev

Can not select the radio button with value using jquery

From Dev

Get the value of a radio button using jquery

From Dev

Get selected button's value from Polymer radio group with jquery

From Dev

how to set a radio button value in protractor

From Dev

How to set a default radio button with a value?

From Dev

How to pass the selected value of radio button using JavaScript from popup window to parent window?

From Dev

Getting radio button selected value

From Dev

Default Radio button selected value

Related Related

  1. 1

    jquery mobile set selected value of a radio button group

  2. 2

    If radio button is selected and select value is selected jquery

  3. 3

    Trying to get value of selected radio button using ajax/jquery

  4. 4

    How to get the value of a selected radio button and checkbox using its class in jQuery?

  5. 5

    How to get the NAME and value of a radio button when DYNAMICALLY selected - in jQuery?

  6. 6

    How to get selected value of list item in radio button list in jquery

  7. 7

    How to get the NAME and value of a radio button when DYNAMICALLY selected - in jQuery?

  8. 8

    How to set selected radio button in IONIC using angularJS

  9. 9

    How to get value of selected radio button?

  10. 10

    How to get value of selected radio button in angularjs

  11. 11

    How To get Selected Radio Button Value in Mvc

  12. 12

    How to get the value of the selected radio button?

  13. 13

    How get value of selected radio button in datalist

  14. 14

    How to know which radio button is selected in jquery?

  15. 15

    How can I set the default radio button using jquery

  16. 16

    How to set checked radio button using name and attr in jquery?

  17. 17

    How do I check which radio button is selected when there are multiple radio buttons with the same name? (using jquery)

  18. 18

    How to display a radio button selected using a variable?

  19. 19

    Jquery for pass selected radio button value on button click

  20. 20

    Set the class on selected radio button

  21. 21

    Show the Value of Radio button using Jquery

  22. 22

    Can not select the radio button with value using jquery

  23. 23

    Get the value of a radio button using jquery

  24. 24

    Get selected button's value from Polymer radio group with jquery

  25. 25

    how to set a radio button value in protractor

  26. 26

    How to set a default radio button with a value?

  27. 27

    How to pass the selected value of radio button using JavaScript from popup window to parent window?

  28. 28

    Getting radio button selected value

  29. 29

    Default Radio button selected value

HotTag

Archive