I have four button on a form. Whenever one of the button is clicked i want javascript to redirect to the new page and change the header depending on what button was clicked. I tried using window.document.write to replace the header text but that didn't work. Here is my code:
$('#claimant_search_button', '#ca_search_button', '#emp_search_button',
'#ea_search_button')
{
if (this.id == 'claimant_add_button') {
window.location("https://dol-oalj-dev.entellitrak.com/etk-dol-oalj-dev/tracking.base.create.request.do?dataObjectKey=object.maintenanceForm&button=claimant");
} else if (this.id == 'ca_add_button') {
window.location("https://dol-oalj-dev.entellitrak.com/etk-dol-oalj-dev/tracking.base.create.request.do?dataObjectKey=object.maintenanceForm&button=ca");
} else if (this.id == 'emp_add_button') {
window.location("https://dol-oalj-dev.entellitrak.com/etk-dol-oalj-dev/tracking.base.create.request.do?dataObjectKey=object.maintenanceForm&button=emp");
} else if (this.id == 'ea_add_button') {
window.location("https://dol-oalj-dev.entellitrak.com/etk-dol-oalj-dev/tracking.base.create.request.do?dataObjectKey=object.maintenanceForm&button=ea");
}
}
Here is the header that i have on the redirected page:
<h1 id ="title_form "style="margin-bottom: 25px;"> Maintenance Form </h1>
If the user clicks claimant_search_button. I want the page to redirect to:
and then change the header to say "Claimant Maintenance Form"