In UI:
1) I have to check the ComboBox 2) As HTTPGET send the selected value of ComboBox 3) Then Uncheck the ComboBox, after execution of Controller Action Method.
Code:
$("#Search").click(function () {
$(".selsts").attr('checked', false);
});
This is my JQuery to uncheck the ComboBox On Button Click "Search".
Problem:
Before sending the Value to the controller Action, the checkbox get Unchecked and hence I am not receiving the CheckBox Value.
@using (@Html.BeginForm("GetExtMsg", "ShowMessage", FormMethod.Get))
{
<div id="inputFields">
<div class="inputLabel"><label><b>Search By:</b></label> </div>
</div>
@Html.CheckBox("Review", new { @class="selsts" })
<label style="float: left;">Review Status</label>
@Html.CheckBox("Corellation", new { @class = "selsts" })
<label style="float: left;">Corellation</label>
@Html.CheckBox("ControllerStatus", new { @class = "selsts" })
<label style="float: left;">Controllers</label>
@Html.CheckBox("Team", new { @class = "selsts" })
<label style="float: left;">Team</label>
@Html.DropDownList("ReviewsearchType", new List<SelectListItem>
{
new SelectListItem { Text = "Reviewed", Value = "Reviewed" },
new SelectListItem { Text = "Review Done", Value = "Review Done" },
new SelectListItem { Text = "Authorized", Value = "Authorized" }
}, "Select")
@Html.DropDownList("CorellationsearchType", new List<SelectListItem>
{
new SelectListItem { Text = "A", Value = "A" },
new SelectListItem { Text = "B", Value = "B" },
}, "Select")
@Html.DropDownList("ControllersearchType", new List<SelectListItem>
{
new SelectListItem { Text = "True", Value = "True" },
new SelectListItem { Text = "False", Value = "False" },
}, "Select")
<input type="submit" id="Search" value="Search" class="button_gray" />
}
JavaScript :
<script type="text/javascript">
$(function () {
$('#ReviewsearchType').hide();
$("#Review").change(function () {
$('#ReviewsearchType').toggle(this.checked)
})
$('#CorellationsearchType').hide();
$("#Corellation").change(function () {
$('#CorellationsearchType').toggle(this.checked)
});
$('#ControllersearchType').hide();
$("#ControllerStatus").change(function () {
$('#ControllersearchType').toggle(this.checked)
})
$("#Search").click(function () {
$(".selsts").attr('checked', false);
});
});
Any Suggessions/Help?