I am using Asp.net MVC 4 with C#. I am using a Text box, Drop down and checkbox altogether in a page as a search filter. I am using a button clear to clear the values.while clicking clear button I need to clear the value in textbox, show the "select here" on dropdown(My dropdown values are "Select here", "Value1", "Value2") and uncheck the check box. How to write the script function? My coding is below..
<div class-="container">
<div class="row">
<div class="col-xs-4 col-md-4">
<label>Id</label> @Html.TextBoxFor(model => model.Id, new { @class = "form-control" })
</div>
<div class="col-xs-4 col-md-4">
<label>Role</label>
@Html.DropDownList("SelectRole", new SelectList(@ViewBag._RViewBag, "Key", "Value", Model.Role), new { @class = "form-control" })
</div>
<div class="col-xs-4 col-md-4">
<br />
@Html.CheckBoxFor(model => model.Status) <label style="font-size:large"> Status</label></div>
</div>
</div>
<div class="col-md-4 btn-top">
<a href="#" class="btn btn-suucess btn-block">Search</a></div>
<div class="col-md-4 btn-top"><a onclick="Clear()" class="btn btn-success btn-block">Clear</a></div>
Can Anyone help me write the Clear Function?
formand add abuttonof typeresetresettype. Mind blown. Also, you should create an answer, instead of a comment, because your comment appears to directly answer his question.