You are viewing limited content. For full access, please sign in.

Question

Question

Using Time Selector

asked on November 6, 2017

Hello everyone,

I have applied the timepicker js/css for a form I have helping with a customer and we got it to increment every 15 minutes, but now we are stuck with it not being a valid value. I am guessing it's the am/pm after the time... I am not sure how to format it or correct this for Forms.

We are using a Time field in the form's layout. 

LFForms version 10.2.1.205

 

 

Thanks so much! 

0 0

Answer

SELECTED ANSWER
replied on November 7, 2017

It looks like you set the attribute of time on the time field. It should be set on a single line field.

Also it looks like your timepicker function should be running on a single line field.

Once you choose a time type field in forms, your going to be bound to the built in restrictions. A single line should just be an input field with no restrictions.

1 0

Replies

replied on November 6, 2017

I think your correct. With this type of field an AM/PM drop down has been added and the system expects only a time in the input box.

Can you remove am/pm from the text in your selection so that it doesn't violate?

If you want am/pm to be part of the same input field, try the time attribute set on a single line field using the javascript below. This time attribute works great on mobile devices too!

//Wait for page to load
$(document).ready(function() {

  $('.yourClassName input').attr("type", "time");

});

 

0 0
replied on November 7, 2017

I am trying to remove the am/pm from the text but can't seem to figure it out. I tried you code above and it did not work: 

0 0
replied on November 7, 2017

I got the time to format the way I wanted but now when I select the time, it does not stick to the field's value.

Here is my JavaScript code:

 

$(document).ready(function () {
    $.getScript('http://localhost/forms/js/jquery.timepicker.js', function() {
      $('.meeting').timepicker({ 'step': 15, 'scrollDefault': 'now', 'timeFormat': 'h:i:s' });
      $('.meeting input').attr("type", "time");
    });
});
 

0 0
SELECTED ANSWER
replied on November 7, 2017

It looks like you set the attribute of time on the time field. It should be set on a single line field.

Also it looks like your timepicker function should be running on a single line field.

Once you choose a time type field in forms, your going to be bound to the built in restrictions. A single line should just be an input field with no restrictions.

1 0
replied on November 7, 2017

Hey Chad,

I actually moved away from the Time field and did what you suggested and ran it on a single line field. It is working great and I appreciate all your help :)

0 0
replied on November 7, 2017

Awesome!

0 0
replied on February 21, 2018

Hi I have the above error and I am using a single line field with 'timepicker'.  If a user clicks in the field the scroll window appears for them to select a time.  However, when they scroll past what is displayed the 'value is required' shows up.  

 

Any ideas???

0 0
replied on June 28, 2018

Ramika,

Did you find a solution to your issue?  I note that when I click submit it works just fine, but it is misleading that the value is required shows up.

Thanks!

0 0
replied on July 5, 2018

nope.  I removed the required option to get rid of the error.  Have you made any progress?

0 0
replied on July 5, 2018

I put in a default value on the field itself (as compared to in the javascript calling the picker) and that works around the issue.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.