Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
How to disabled picked date in daterangepicker connected to database

How to disable date already picked before in PHP 5 and database using MYSQL, and I tried several time but nothing to work, and I tried to make a booking system

              <div class="row">
              <div class="col-xs-3">
                <label class="form-control" style="border:none;">Publish Date</label>
              </div>
              <div class="col-xs-3">
                <input type="text" name="txtPublishDate" id="txtPublishDate" class="form-control" value="<?php echo $PublishDate; ?>" placeholder="Publish Date" />
              </div>
          </div>


<script>
$(function() {
    $('input[name="txtPublishDate"]').daterangepicker({
        opens: 'right'
    }, function(start, end, label) {
        console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
    });
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

<input .... <?php echo is_string($PublishDate) ? ' disabled="disabled" readonly' : ''; ?> />

Or, don't even put the input based on if you've already picked it. Show the chosen value in a tag like a span instead. Then the JS won't bind to the disabled input. eg:

<?php if !is_string($PublishDate) { ?>
  <input .... />
<?php } else { ?>
  <span><?php echo $PublishDate ?></span>
<?php } ?>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!