Click here to Skip to main content
15,918,243 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have three radiobutton.if i check 1 radiobutton it shows the value false.it should be true plz help me i am using mvc with razor.
C#
<label>
														<input name="same" type="radio" class="ace" id="Cprocess" value="Cprocess" checked="@ViewBag.Cprocess"/>
														 Cycle In Process
													</label>

same for other 2
Posted
Updated 29-May-14 1:04am
v3
Comments
KaushalJB 29-May-14 6:51am    
Update Question and Post your code that you have tried with your HTML Design...
Murali Vijay 29-May-14 8:18am    
Post your view source code after we can identify where you have done mistake.

1 solution

XML
<script src="~/Scripts/jquery-2.1.1.js"></script>
<script type="text/javascript">
    $(document). ready(function () {
        $(document).on("click", "#radio1", function (e) {
            if ($(this).is(":checked"))
        {
            alert("true");
        }
        });

    });

</script>



@Html.RadioButtonFor(model => model.radio1, new { @id = "radio1", @class = "radio" })


i Hope this helps u
 
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