Posts

Showing posts from March, 2020

jQuery DatePicker in MVC

Code:       <script>         $(document).ready(function () {             $("#StartDate").datepicker({                 dateFormat: "dd-mm-yy",                 changeMonth: false,                 changeYear: false,                 yearRange: "-0:+0",                 numberOfMonths :1,//This Property is use to set Diplay Number Of month                 buttonText: "submit",                                  onSelect: function (selectDate) {                     $("#EndDate").datepicker("option", "minDate",selectDate)//Set the...

How To insert CheckBox Data in Database -- MVC

View Code : <div class="form-horizontal">     <h4>CheckBoxModel</h4>     <hr />     @Html.ValidationSummary(true, "", new { @class = "text-danger" })          <div class="form-group">         @Html.LabelFor(model => model.song, htmlAttributes: new { @class = "control-label col-md-2" })          <div class="form-group">         @Html.LabelFor(model => model.hoky, htmlAttributes: new { @class = "control-label col-md-2" })         <div class="col-md-10">             @Html.EditorFor(model => model.hoky, new { htmlAttributes = new { @class = "form-control" } })             @Html.ValidationMessageFor(model => model.hoky, "", new { @class = "text-danger" })         </div>     ...

How To insert Radio Button Data in DataBase -- MVC

View code :   <div class="form-horizontal">         <h4>MyRadioButtonDemo</h4>         <hr />         @Html.ValidationSummary(true, "", new { @class = "text-danger" })         <div class="form-group ">             @Html.LabelFor(model => model.Gender, htmlAttributes: new { @class = "control-label col-md-2" })             <div class="col-md-10 " >                 <label class="radio-inline">                     @Html.RadioButtonFor(model=>model.Gender,"Male",new { @name="gender"})                     male                 </label>                 <...

insert Data in DataBase using Ajex BeginForm in MVC

View Code : @model Ajex_MVC.Models.MyCroud  @{     ViewBag.Title = "Create"; } <h2>Create</h2> <div id="LodingImg" style="display:none">     <img src="~/Content/img/Loading.jfif" height="100" width="100" /> </div> <div id="DivForUpdate">        </div> @using (Ajax.BeginForm("Create", "Home",                           new AjaxOptions() {                               HttpMethod = "POST",                               InsertionMode = InsertionMode.Replace,                               UpdateTargetId = "DivForUpdate",               ...

jQuery Check Box change Event

Code  jQuery : <script>         $(document).ready(function () {             $("#No").change(function () {                 if ($(this).is(":checked")) {                     var returnVal = confirm("are you sure ??? ");                     $(this).attr("checked", returnVal);                     alert(" no check box is checked");                 }             });         });           </script>