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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:35:59+00:00 2026-05-26T14:35:59+00:00

I am using jEditable plugin with the datepicker but I need validation for the

  • 0

I am using jEditable plugin with the datepicker but I need validation for the date before submit it to the database. So i edit the jEditable-datepicker.js to something like this:

submit: function (settings, original) {
    var form = this;
    var tid = $(original).attr('id');
    var input = $(original).find('input');
    var newDate = input.val();
    alert('id' + tid);
    alert('newdate' + newDate);
    $.ajax({
        async: false,
        url: '/Stock/CompareDate',
        type: 'GET',
        data: { id: tid, inputDate: newDate },
        success: function (result) {
            alert(result);
            if (result < 0) {
                alert("Expiry dare cannot be earlier than storage date");
                return false;
            }
            else {
                alert('else');
                return true;
            }
        }
    });
},

/* attach jquery.ui.datepicker to the input element */
plugin: function (settings, original) {
    var form = this,
      input = form.find("input");

    // Don't cancel inline editing onblur to allow clicking datepicker
    settings.onblur = 'nothing';

    datepicker = {
        dateFormat: 'D, dd M yy'
    };

    input.datepicker(datepicker);
}

I get the alert in the if statement, which means the validation method works, but the invalid value still get submitted to the database. I dont know why the return false dint stop the submit action.. I had tried to solve this problem for a long time, yet this is the time i get closest to the solution. I just dint know how can i stop submission in the if statement…

Do really need help here… Thanks….

(UPDATE: add in html)

My date field is in a table:

        <td id="sdat@(item.FoodID)" class="storagedatepicker">
              @String.Format("{0:ddd, d MMM yyyy}", item.StorageDate)
        </td>
        <td id="edat@(item.FoodID)" class="expirydatepicker">
              @String.Format("{0:ddd, d MMM yyyy}", item.ExpiryDate)

The call to jeditable is like this:

    $('.expirydatepicker').editable('@(Url.Action("Edit", "Stock"))',
    {
        type: 'datepicker',
        indicator: 'saving...',
        event: 'dblclick',
        tooltip: 'Double click to edit...',
        submit: '<img src="../../Content/Add_in_Images/ok.png" alt="ok"/>',
        cancel: '<img src="../../Content/Add_in_Images/cancel.png" alt="cancel"/>',
        style: 'inherit'

    });
  • 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-05-26T14:35:59+00:00Added an answer on May 26, 2026 at 2:35 pm

    Get it work by not trying to stop the submission, but replace the input value with the default value if the validation failed. Thanks

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

Sidebar

Related Questions

I'm using the Edit-in-Place JQuery plugin, JEditable: http://www.appelsiini.net/projects/jeditable . I would like to use
I am using a jQuery jEditable edit-in-place field but when the JSON function returns
I am using jeditable with datepicker and i wish to do some validation once
I have been using the JEditable plugin for JQuery and I would like to
Using Flask Flask-sqlalchemy Sqlalchemy Jquery Datatables (jquery plugin) Jeditable (jquery plugin) Consider this user
I am using JEditable jquery plugin to update some data on my webpage. After
I'm using: jQuery validation plug-in 1.6 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ with the latest version of jQuery.
So I'm using this plugin: jquery-in-place-editor , I'm trying to make a POST request
I'm sure this is simple but I'm banging my head! I'm using the excellent
I'm using the excellent jEditable plugin for some in-place editing on my page. There

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.