Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set picker value from custom javascript #95

Open
nicholas-ewing opened this issue May 30, 2023 · 0 comments
Open

How to set picker value from custom javascript #95

nicholas-ewing opened this issue May 30, 2023 · 0 comments

Comments

@nicholas-ewing
Copy link

I have a button which I want to do a few different things at the same time and I'm lost on how to set the picker's value to the current datetime from my JavaScript. I've tried setting the picker directly and I'm able to see the datetime in the field, but it doesn't carry over to the hidden input. I then tried setting the hidden input directly but it also did not carry over to be visible in the field. Is there a better way to do this than to individually set both?

Setting Picker Field:
$('#completed-datetime')[0].value = dtFormat(new Date(), 'yyyy-mm-dd hh:mmi:ss');

Setting Hidden Input:
$("[name='datetime_completed']")[0].value = dtFormat(new Date(), 'yyyy-mm-dd hh:mmi:ss');

Thanks in advance for any assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant