I have this textbox:
<%= Html.TextBox("EffectiveDate", Model.EffectiveDate.HasValue ? Model.EffectiveDate.Value.ToString("dd-MMM-yyyy") : "", new { @class = "economicTextBox", propertyName = "EffectiveDate", onchange = "parseAndSetDt(this); ", dataType = "Date" })%>
I need JS validation help. If the user has the permission, they can enter any date. If the user doesn't, they can only enter the present date, or dates in the future.
Here is a controller method I have that can get if the user has the permission or not.
[NoCache]
public ActionResult HasAdvanced()
{
if (Chatham.Web.UI.Extranet.SessionManager.DisplayUser.IsInRole("hasICAdvanced"))
{
return Json(
new
{
value = "true"
});
}
else{
return Json(
new
{
value = "false"
});
}
}
What would the Js/JQuery look like? I'm soooo stumped.
Thanks!