jquery - ValidationMessageFor printing default message and not the custom one -


i trying print custom message through mvc model using jquery validation still printing default message , not 1 have specified

code:

model public class task_runsmodel //user use add tasks , comments { public int task_run_id { get; set; }

    [required(errormessage = "you can't leave empty.", allowemptystrings = false)]     public int project_id { get; set; }     public string start_time { get; set; }     public string end_time { get; set; }     public int dead { get; set; }      [required(errormessage = "you can't leave empty.", allowemptystrings = false)]     [range(0, int.maxvalue, errormessage = "you can't leave empty.")]     public int task_id { get; set; }      public int active { get; set; }     public datetime timestamp_dtm { get; set; }     public int userid { get; set; }     [required(errormessage = "you can't leave empty.", allowemptystrings = false)]     public string status { get; set; }      public decimal duration { get; set; }      public string comment1 { get; set; }     public string task_name { get; set; }     public string project_name { get; set; }    } 

html:

<div id="add_task_dialog_box" class="hide"> @using (html.beginform("saveevent", "base", formmethod.post, new { id = "form_data", @class = "form-horizontal", style = "display: none;" })) {     @html.validationsummary(true)     @html.antiforgerytoken()        <fieldset class="form-group">         <div>             <label class="control-label col-xs-12 col-sm-3 no-padding-right " style="font-weight: bold;                 font-size: 13px; text-align: left; font-family: arial unicode ms;">                 project name</label>             <div class="col-xs-12 col-sm-9">                 <div class="clearfix">                     @html.dropdownlistfor(model => model.task_runsmodel.project_id, db.getprojects(a), "--select--", new { style = "width:200px;", id = "myproject" })                 </div>             </div>         </div>         <div>             <label class="control-label col-xs-12 col-sm-3 no-padding-right ">             </label>             <div class="col-xs-12 col-sm-9">                 <div class="clearfix">                     @html.validationmessagefor(model => model.task_runsmodel.project_id, string.empty, new { @class = "id_form_valid error" })                 </div>             </div>         </div>         <br />         <br />         <div class="space-6">         </div>         <div>             <label class="control-label col-xs-12 col-sm-3 no-padding-right " style="font-weight: bold;                 font-size: 13px; text-align: left; font-family: arial unicode ms;">                 select task</label>             <div class="col-xs-12 col-sm-9">                 <div class="clearfix">                     @html.dropdownlistfor(model => model.task_runsmodel.task_id, db.gettasks(a, c), "--select--", new { style = "width:200px;", id = "mytask" })                 </div>             </div>         </div>         <div>             <label class="control-label col-xs-12 col-sm-3 no-padding-right ">             </label>             <div class="col-xs-12 col-sm-9">                 <div class="clearfix validation-summary-valid">                     @html.validationmessagefor(model => model.task_runsmodel.task_id, string.empty, new { @class = "id_form_valid error" })                 </div>             </div>         </div>         <br />         <br />         <div class="space-6">         </div>         <div>             <label class="control-label col-xs-12 col-sm-3 no-padding-right " style="font-weight: bold;                 font-size: 13px; text-align: left; font-family: arial unicode ms;">                 status</label>             <div class="col-xs-12 col-sm-9">                 <div class="clearfix">                     @html.dropdownlistfor(model => model.task_runsmodel.status, db.getstatus(), "---select---", new { style = "width:200px", id = "taskstatus", name = "taskname" })                 </div>             </div>         </div>         <div>             <label class="control-label col-xs-12 col-sm-3 no-padding-right ">             </label>             <div class="col-xs-12 col-sm-9">                 <div class="clearfix">                     @html.validationmessagefor(model => model.task_runsmodel.status, string.empty, new { @class = "id_form_valid error" })                 </div>             </div>         </div>         <div class="col-lg-12 col-md-3 col-sm-3 col-xs-12">             <div id="chatarea" class="dropdown-toggle" style="float: left; padding-left: 20px;                 overflow-y: auto; overflow-x: auto;">             </div>             <b style="float: right; padding-right: 20px;" class="glyphicon glyphicon-chevron-down"                 id="displaycomment"></b>         </div>         <div id="textareadiv" style="padding-top: 3px;">             <span class="col-lg-3 col-md-3 col-sm-9 col-xs-12" style="padding-left: 12px; width: inherit;">@html.textareafor(model => model.task_runsmodel.comment1, new { id = "comment", ariahidden = "true", placeholder = "write comment", @class = "form-control wp-editor-area", cols = "65", rows = "3", style = " width: calc(100%);" })             </span>         </div>      </fieldset>   } 


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -