ZCoder
ZCoder

Reputation: 2339

Radio button value check in action is true or false

I am new in MVC. I am working on a view where I add two radio buttons.

<label for="lDIV1">
    <input id="lDIV1" type="radio" name='rbtab' value='DIV1' onclick="javascript:custom()" />Create
    Email:</label>
<label for="lDIV2">
    <input id="lDIV2" type="radio" name='rbtab' checked="checked"  value='DIV2' onclick="javascript:defaul()" />Default
    Email:</label>
<div id='Content' style="display: block">

Now I want to call a function in Action {Http} that is if first radio button is true then call radiobutton1() method or else call radiobutton2() method Can you guys Help me out how to apply conditions..

Upvotes: 0

Views: 1024

Answers (1)

Dejan.S
Dejan.S

Reputation: 19128

im not sure what you want to do because your question is not that clear but here is how you can do something when a checkbox is checked with jquery

http://jsfiddle.net/HQXLm/1/

<input id="checkme" type="checkbox" /> click me to find out if im checked

$('#checkme').click(function(){
    if ($(this).is(':checked')){
         alert('I am checked, do something here');   
    }
});

Upvotes: 1

Related Questions