Topic: Datepicker resulting in Object not found! when max date set and moving to following month

AJEsler2019 priority asked 4 years ago


Expected behavior

Be able to move to the next month cleanly when a max date has been set. When no max date has been set, the next month selection works fine.

Actual behavior

Receiving an Error 404, Object not found message, per direct copy from browser window below..

Resources (screenshots, code snippets etc.)

Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404 localhost Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.5


AJEsler2019 priority commented 4 years ago

Just confirmed the same error occurs if min date is set and you select the prior month


Grzegorz Bujański staff commented 4 years ago

How can I reproduce this problem? Can you create a snippet with the above issue here?


AJEsler2019 priority answered 4 years ago


Date Picker Error

$(document).ready(function() { $('.datepicker').pickadate({ format: 'dd mmm yyyy', formatSubmit: 'yyyy-mm-dd', }); var purchasedFrom = $('#rPurchasedFromDate').pickadate(), purchasedFromPicker = purchasedFrom.pickadate('picker'); var purchasedTo = $('#rPurchasedToDate').pickadate(), purchasedToPicker = purchasedTo.pickadate('picker'); purchasedFromPicker.on('set', function (event) { if (event.select) { purchasedToPicker.set('min', purchasedFromPicker.get('select')); } else if ('clear' in event) { purchasedToPicker.set('min', false); } }) purchasedToPicker.on('set', function (event) { if (event.select) { purchasedFromPicker.set('max', purchasedToPicker.get('select')); } else if ('clear' in event) { purchasedFromPicker.set('max', false); } }) });
    <form action="_tmp.php" method="post">

      <!-- Date Range -->
      <div>
        <div name="rPurchasedDatePicker" id="rPurchasedDatePicker">
          <div class="md-form">
            <input type="text" class="form-control datepicker" name="rPurchasedFromDate" id="rPurchasedFromDate" placeholder="Select date">
            <label for="rPurchasedFromDate">Date from</label>
          </div>
          <div class="md-form">
            <input type="text" class="form-control datepicker" name="rPurchasedToDate" id="rPurchasedToDate" placeholder="Select date">
            <label for="rPurchasedToDate">Date to</label>
          </div>
        </div>
      </div>

    </form>  <!-- Purchased By -->


Grzegorz Bujański staff commented 4 years ago

I pasted your code into snippet and I can't reproduce this issue. I have no errors in the console when changing the month


AJEsler2019 priority commented 4 years ago

Have you tried this snippet: "Form being incorrectly submitted by date picker by AJEsler2019"? Select a date in the "Date from" date picker box. Select the "Date to" box and the dates prior to the date selected above should be greyed out. Click on the prior month arrow. An error occurs showing "Cannot POST /jquery/ajesler2019/_tmp.php". Hence it appears to be an error with the month prior / next month "submitting" the form.


Grzegorz Bujański staff commented 4 years ago

Ok. Now i can see. I add this to our todo list. We will fix this.


AJEsler2019 priority commented 4 years ago

Thanks for this. Appreciate your assistance


Grzegorz Bujański staff commented 4 years ago

You're welcome.


Grzegorz Bujański staff commented 4 years ago

You're welcome.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.18.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No