Set datepicker to readonly using javascript/jquery

Confluence User - 22 May, 2020

Hi Experts,

I have a created a script to count total days between 2 date in a datepicker. It works. However, I wouldn't want the user to able to edit the date. By set the section or the datepicker field to readonly using Joget-already has function, the script to calculate the total days is not working.


Below shows day of process not working when both date is set to readonly using Joget Readonly function:


I have tried many different syntax to do this however all of them doesn't work. Here's my reference: https://stackoverflow.com/questions/7812063/jquery-datepicker-readonly . Can anyone help me :<

datepicker;joget;javascript;customcode

4


23 May, 2020
confluenceUser
confluenceUser

Hi, from the screenshot the readonly date is shown in a textfield. In any case, you can try to obtain the value of a field using Javascript API#getValue(fieldId).

27 May, 2020
confluenceUser
confluenceUser

hi Mr Anders. It's actually a datepicker. below is the full screenshot. 

28 May, 2020
confluenceUser
confluenceUser

Yes, but it appears to revert to a textfield when it is readonly.

29 May, 2020
confluenceUser
confluenceUser

oh no actually still datepicker. it looks like textfield because the blue arrow is hiding it

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print