Page 1 of 1

Refresh HTML object and rerun JavaScript on Form

Posted: Mon May 17, 2021 4:43 pm
by oli
Hi,

I need to create a calendar on a form:
Therefore I created a :
- new Form where the JavaScript is defined to create the calendar
- HTML Object (to show the calendar)
- Date Picker to select the month that should be displayed

I didn't find a way how to use the selected date from the Input object (Datum) and to refresh the calendar based on the selected month of the input object.

Is there a way to forward the selected date to the JavaScript and to re-build the calendar without storing the value of the input object in the database?
calendar.jpg
BR,
Oli

Re: Refresh HTML object and rerun JavaScript on Form

Posted: Mon May 17, 2021 4:56 pm
by kev1n
If you have a JS function where the calendar is created, call that by passing the date of the input.

e.g.:

Code: Select all

function createMyCalendar(date) {
  // ... code to create the calendar...
}

Call in the onchange event of your date input:

Code: Select all

createMyCalendar($('#your_date_object_id').val());

Re: Refresh HTML object and rerun JavaScript on Form

Posted: Tue May 18, 2021 12:07 pm
by oli
Thank you ... works great.

Now I have another issue.

I need to refresh the form once the date field was changed.
I tried using this in the onchange code of the date selector:

Code: Select all

nuGetBreadcrumb();
which is not working and I can't do any change on the form. Is there another possibility I could use therefore?

BR,
Oli

Re: Refresh HTML object and rerun JavaScript on Form

Posted: Tue May 18, 2021 1:26 pm
by kev1n
Does this work?

Code: Select all

nuHasNotBeenEdited();
nuGetBreadcrumb();