2012-01-24 30 views
0

我在MVC是新的。我正在研究添加兩個單選按鈕的視圖。單選按鈕值檢查是真的還是假

<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"> 

現在,我想打電話給在行動{的Http}這是一個函數,如果第一個單選按鈕爲真,則調用radiobutton1()方法或者調用radiobutton2()方法 你們能幫助我如何申請條件..

回答

1

林不知道你想做的事,因爲你的問題是不是清楚了,但這裏是當一個複選框使用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'); 
    } 
}); 
檢查你如何能做到什麼
相關問題