Modal form, js update of index and datepicker