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

Question

Question

BUG in laserfiche forms datatimepicker ??

asked on January 20, 2017

Hello all ,

i want to report a suspicious behavior, in laserfiche forms.

if we programmatically make aDate field readonly, and then we click on it, it will become a readonly normal text field, if we make it readonly=false, the field will be a text field with no calendar or date picker option.

please see the example below.

 

this is the original section

then when we make the "to Date" Field readonly and then we click on it, it becomes as follows.

then if we re-enable it it will be a textbox with no datepicker.

 

i am using .attr("readonly",True/False) for the required action.

please advice.

 

Maher Daher.

0 0

Answer

SELECTED ANSWER
replied on January 20, 2017

Hi Maher,

You should be setting the readonly property of the element, not the attribute. For example:

$('.className input').prop('readonly',false);

You can see this thread for more information.

With that, there are three cases of behavior:

  1. Set field to read-only using the Form editor UI: works as expected; field is read-only and the datepicker does not appear.
  2. Set readonly property to 'false' using JavaScript: works as expected; field is not read-only and datepicker appears.
  3. Set readonly property to 'true' using JavaScript: field is read-only but datepicker appears. When clicking anywhere in the field, the datepicker disappears and the browser console reports a script error. I've filed SCR 153763 to address this behavior, so the datepicker does not appear when the field is set to read-only programmatically.

Thanks for bringing this up.

3 0
replied on January 22, 2017

hello James,

 

I have tried what you suggested, and still the behavior of the datepicker field is similar to the third case of the behaviors that you listed.

In addition, when i try to make the field not readonly using javascript, it will become not readonly but the datepicker disappears, it becomes a normal textfield, with the browser reporting an error.

 

Thank You.

0 0

Replies

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

Sign in to reply to this post.