I have
jQuery( "#art-calendar-"+infoModalType+"-event-link-url" ).html('<a target="_blank" href="'+calendarEvent.eventLinkUrl+'">'+calendarEvent.eventLinkUrl+'</a>');
in my .js file
and
<button type="button" id="button-1" type="submit">
Button that loads new page
</button>
in .php file
How can I make a button with custom text, that, onclick, loads a new page instead of showing the url?
This line had to go into the javascript file:
jQuery('#Termin').attr('action', calendarEvent.eventLinkUrl);
and the next three lines into the PHP file:
<form id="Termin" action="" method="post">
<button type="submit">jetzt Termin buchen</button>
</form>
The jQuery command adds the calendarEvent + EventURL into the empty action-attribute of the form button called #Termin. This way, the form gets a dynamically produced URL that is being loaded, when clicking the button with the ID Termin.