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

The Archive Base Latest Questions

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

I am using jeditable with datepicker and i wish to do some validation once

  • 0

I am using jeditable with datepicker and i wish to do some validation once user select a date before submit it to the database. I gone through the jeditable-datepicker.js and realized that the submission is triggered once onselect event happened. How can I include conditions in the event so invalid date wont be submitted to the database?

Here is my trial by using the onsubmit event:

 $('.expirydatepicker').editable('@(Url.Action("Edit", "Stock"))',
    {
        type: 'datepicker',
        indicator: 'saving...',
        event: 'dblclick',
        tooltip: 'Double click to edit...',
        style: 'inherit',
        width: ($('.datepicker').width() - 10) + "px",
        onsubmit: function (settings, td) {
            var tid = $(td).attr('id');
            //alert(tid);
            $.ajax({
                async: false,
                url: '/Stock/CompareDate',
                type: 'GET',
                data: { id: tid },
                success: function (result) {
                    if (result < 0) {
                        alert("Expiry dare cannot be earlier than storage date");
                        return onSelect(false);
                    }
                    else {
                        return true;
                    }
                }
            });
        }
    });

the jEditable-datepicker function :

/* 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',
    onSelect: function() {
      // clicking specific day in the calendar should
      // submit the form and close the input field
      form.submit();
    },

I wish to know is there anyway I can either “stop” the onselect event if the input is invalid??
Hope can get some help here… thanks….

  • 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:42:13+00:00Added an answer on May 26, 2026 at 2:42 pm

    i get it done by not stopping the submission, but change the input value back to default value if validation failed. This is the only way I could get it done. Thanks!

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

Sidebar

Related Questions

I am using jEditable plugin with the datepicker but I need validation for the
I am using JEditable jquery plugin to update some data on my webpage. After
I'm using the excellent jEditable plugin for some in-place editing on my page. There
Any tips for form validation using jeditable. I would like to have the script
I'm using the jQuery jEditable plug-in to edit some part of a website. As
I'm using JEditable and trying to populate a select based on a variable. I
I'm using Jeditable for in-place editing. One the controls I am working with has
I am trying to style an input-box rendered using jEditable . I want to
I am using a jQuery jEditable edit-in-place field but when the JSON function returns
the solution here: Jeditable CANCEL callback from AJAX callback? using onreset() doesnt seem to

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.