Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Help with timepicker, not picking the time.

Capwell pro asked 6 years ago


LINK: https://www.landscape-lifestyles.co.uk/services.html Instructions: Enter the page.Click on \"Book a Survey\".Select under \"Preferred time to visit*\".From there the time picker should appear. However, you are unable to select a time and defaults to 00:00. NOTE: I have this working perfectly, within the modal popup. It seems to have now broken. <script type=\"text/javascript\"> $(document).ready(function() { $(\'[data-toggle=\"tooltip\"]\').tooltip() }); // Material Select Initialization $(document).ready(function() { $(\'.mdb-select\').material_select(); }); // Data Picker Initialization $(\'.datepicker\').pickadate(); // Time Picker Initialization $(\'#service_time\').pickatime({ twelvehour: false; }); // When the user clicks on the button, scroll to the top of the document function topFunction() { document.body.scrollTop = 0; // For Safari document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera } SurveyForm = function(){ $(\'.survey-form\').each(function(){ var formInstance = $(this); formInstance.submit(function(){ var action = $(this).attr(\'action\'); $(\"#service-message\").slideUp(750,function() { $(\'#service-message\').hide(); $(\'#service-submit\') .after(\'<img src=\"images/assets/ajax-loader.gif\" class=\"loader\" />\') .attr(\'disabled\',\'disabled\'); $.post(action, { service_name: $(\'#service-name\').val(), service_email: $(\'#service-email\').val(), service_phone: $(\'#service-phone\').val(), service_address: $(\'#service-address\').val(), service_date: $(\'#service-date\').val(), service_time: $(\'#service-time\').val(), service_type: $(\'#service-type\').val(), service_comments: $(\'#service-comments\').val() }, function(data){ document.getElementById(\'service-message\').innerHTML = data; $(\'#service-message\').slideDown(\'slow\'); $(\'.survey-form img.loader\').fadeOut(\'slow\',function(){$(this).remove()}); $(\'#service-submit\').removeAttr(\'disabled\'); if(data.match(\'success\') !== null) $(\'.survey-form\').slideUp(\'slow\'); } ); }); return false; }); }); }  </script>

Mikołaj Smoleński staff answered 6 years ago


Hello, Here You have working example with modal and time picker, created specially for You:
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
 Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
 <div class="modal-dialog" role="document">
 <div class="modal-content">
 <div class="modal-header">
 <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
 <span aria-hidden="true">&times;</span>
 </button>
 </div>
 <div class="modal-body">
 <div class="md-form">
 <input placeholder="Selected time" type="text" id="input_starttime" class="form-control timepicker">
 <label for="input_starttime">Light version, 12hours</label>
 </div>
 </div>
 <div class="modal-footer">
 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
 <button type="button" class="btn btn-primary">Save changes</button>
 </div>
 </div>
 </div>
</div>
Regards

Mikołaj Smoleński staff commented 6 years ago

What is the main difference between Your modal and this one?

Capwell pro commented 6 years ago

How do you type code? in that box?

Capwell pro commented 6 years ago

I've posted: both here for review. https://github.com/CapGamNet/mdbsupportmodals/

Mikołaj Smoleński staff commented 6 years ago

Thanks for creating the repository, it's very helpful. Very important part of adding pickers to Your own projects is setting a wrapper with class 'md-form'. While changing Your input with the following code, picker is working correct: <div class="md-form"> <input placeholder="Selected time" type="text" id="input_starttime" class="form-control timepicker"> <label for="input_starttime">Light version, 12hours</label> </div> Regards

Capwell pro commented 6 years ago

The Light version, 12hours Doesn't work. Remember, i'm using ver 4.4.4

Mikołaj Smoleński staff commented 6 years ago

Could You make an update to the latest version? Version 4.5.0 contains many important solutions.


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: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags