Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8933449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:32:21+00:00 2026-06-15T09:32:21+00:00

Is there any possibility of rectifying the input at client side using Remote Validation?

  • 0

Is there any possibility of rectifying the input at client side using Remote Validation?
For example, the user will enter the date as 010101 which means 01-Jan-2001, can Remote Validation reflect/pass the rectified value (010101 into 01-Jan-2001) at/to client side?

I have a scenario where i have JS to format the input into correct date format. Later on i had to use RemoteValidation. My remote validation receives date in ddmmyy format (RemoteValidation gets called before JS), it first converts it into correct date and then perform validation, and then my JS does not get called at all and so 010101 is not get converted into 01-Jan-2001.

Edit

There are two things i would like to get help for

1- Is there anyway a remote validation function can modify the model/data passed to it for validation and then pass it back to the view so that user can see the modified version of the model/data

[Deleted:2- I have JavaScript for a date field which formats the date when focus is lost. It is working fine. When i used Remote validation along with JS, the script does not get called at all.]

Edit

Model

public class master
{
    public string sometext { get; set; }
    public child mychild { get; set; }
}   

public class child
{
    public child()
    {
        thedate = DateTime.MaxValue;
    }
    [Remote("ValidateDate", "Test", ErrorMessage = "Invalid Date")]
    [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:mm/dd/yyyy}", NullDisplayText = "Enter Date")]
    public DateTime? thedate { get; set; }
}

View

@model Models.master
@using Web.Framework

@{
    Layout = null;
    }

<html>
<head>
    <title>Test - My ASP.NET MVC Application</title>
        <script src="@Url.Scripts("jquery-1.7.1.min.js")" type="text/javascript"></script>
        <script src="@Url.Scripts("jquery-ui-1.8.11.js")" type="text/javascript"></script>
        <script src="@Url.Scripts("modernizr-2.0.6-development-only.js")" type="text/javascript"></script>
        <script src="@Url.Scripts("AjaxLogin.js")" type="text/javascript"></script>
        <script src="@Url.Scripts("jquery.validate.min.js")" type="text/javascript"></script>
        <script src="@Url.Scripts("jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
        <script src="@Url.Scripts("jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
        <script src="@Url.Scripts("MicrosoftAjax.js")" type="text/javascript"></script>
        <script src="@Url.Scripts("MicrosoftMvcAjax.js")" type="text/javascript"></script>

        <script src="@Url.Scripts("myScripts.js")" type="text/javascript"></script>
</head>
<body>
@using (Html.BeginForm("testSubmit", "Test"))
{
    @Html.LabelFor(m => m.sometext)
    <br />
    @Html.TextBoxFor(m => m.sometext)
    <br />

    @Html.LabelFor(m => m.mychild.thedate)
    <br />
    @Html.TextBoxFor(m => m.mychild.thedate, new { onblur = "doDate(this, '');" })
    @Html.ValidationMessageFor(m => m.mychild.thedate)

        <br />
    <input type="submit" value = "Submit me" />   
}
</body></html>

Controller

public ActionResult testSubmit(master model)
{
    @ViewBag.Message = "OK";
    return View("response");
}

public JsonResult ValidateDate(DateTime? thedate)
{
    return Json(HttpContext.Request.QueryString["mychild.thedate"].ToString(), JsonRequestBehavior.AllowGet);
}

My remote validator always receives null in thedate, but i can access the value from query string but the value is unformatted i.e. Remote validation gets called before JS which means i have to format the date first in remote function and then validate, once validated then this input is formatted again by JS and both have to be synced.

Now, how can i get the formatted value in Remote function OR pass the formatted value from Remote function to the View ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:32:22+00:00Added an answer on June 15, 2026 at 9:32 am

    Since i didn’t get any answer so the answer, so far, is “No”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any possibility of having a button which will execute and action in
Is there any possibility to upload a file (for example: an image), to a
Is there any possibility to set behavior on TFS that will build a project
is there any possibility to change an image's resolution on clientside (using CSS, Javascript,
Is there any possibility to send SMS without using the launcher task: SmsComposeTask in
Is there any possibility to make update in the database by using LINQ only
Is there any possibility to operate with locksreen image in windowsPhone? For example, writing
is there any possibility to determine the timezone of point (lat/lon) without using webservices?
Is there any possibility to call webservice using jQuery 1.0.pack.js?
Is there any possibility of assigning user agent string to web browser control in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.