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 7844399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:51:48+00:00 2026-06-02T16:51:48+00:00

Im trying to get the values from my datepicker into a new script which

  • 0

Im trying to get the values from my datepicker into a new script which should validate that the second chosen value from datepicker is not before the first chosen datepicker.

However, my script won’t execute.

This is my view:

 <div class="editor-field">
        @Html.TextBox("PlannedDate", Model.PlannedDate, new { @class = "date", @readonly = "readonly" })
        @Html.TextBox("CompletedDate", Model.CompletedDate, new { @class = "date", @readonly = "readonly" })
        @Html.ValidationMessageFor(model => model.CompanyName)
    </div>
 <input id="submitfloat" type="submit" value="Go" />

This is my Script

  <script>
  $(".date").datepicker();
  $('#submitfloat').submit(function() {
  var fromDate = $('#PlannedDate').val();
  var EndDate = $('#CompletedDate').val();
  if (Date.parse(fromDate) > Date.parse(EndDate)) {
    alert("Date error")
    }
    return false;

});

However, when I start debug ut Firebug, it seems like my line $('#submitfloat').submit(function() { wont execute.

Anyone know what my problem is and how it can be solved? Thanks in advance

  • 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-02T16:51:51+00:00Added an answer on June 2, 2026 at 4:51 pm

    well my first answer, i hope it help you.

    first my view:

        <script src="Js/jquery.min.js" type="text/javascript"></script>
        <script src="Js/jquery.validate.min.js" type="text/javascript"></script>
        <script src="Js/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
        <link href="Css/start/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
    

    i use that for the date picker and the validation

        <form id="custom" action="">
             <input type="text" id="fechaLlegada" name="fechaL" style="color: #4080BF; font: bold 12px verdana; padding: 0 2px 3px 2px;"/> 
             <input type="text" id="fechaSalida" name="fechaS" style="color: #4080BF; font: bold 12px verdana; padding: 0 2px 3px 2px;"/>
             <br />
             <input type="submit"/>
        </form>
    

    now the script

        <script type="text/javascript">
    jQuery.validator.addMethod("isValid", function (value, element) {
        var startDate = $('#fechaLlegada').val();
        var finDate = $('#fechaSalida').val();
        return Date.parse(startDate) < Date.parse(finDate);
    }, "* End date must be after start date");
    
    $(function () {
        $('#fechaLlegada,#fechaSalida').datepicker()
    
        $('#custom').validate({
            rules: {
                'fechaL': { required: true, date: true },
                'fechaS': { required: true, date: true, isValid: true }
            }, messages: {
                'fechaL': { required: 'date required msj!',
                    date: 'invalid date format msj'
                },
                'fechaS': { required: 'date required msj!',
                    date: 'invalid date format msj',
                    isValid: 'End date must be after start date'
                }
            }
        });
    
    });
    </script>
    

    i added a method to the jquery validate for the date Validation then i use it as a rule in the validation script

    this is working for me, i hope it helps someone
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a json string back from my controller, that is prefill-values
Hello I have two text inputs which get their values from a datepicker. What
I am trying to get values from a view which i have the code
I'm trying to get values from a JSP using getParameter which includes ü,é,à etc.
I am trying to get values from a table that lives inside an iframe
Im trying to get values from a ListBox that has multiselection and dynamic ListItems
I am trying to get values from classes by reflection. The thing is that
So I'm trying to get the values from a SQLite database into a cursor,
I'm working on a script and trying to get some values from an array
Am trying to get values from a text file in which entries are delimited

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.