I use tx_news to show jobs records (list and detail view). On the detail page of a record I have a link to a application form:
Detail.html
<f:link.page pageUid="21" class="btn btn-primary">Application</f:link.page>
... for the application form I use powermail. Here I have a select and I fill the select option values with the job records like this:
lib.joboptions = CONTENT
lib.joboptions {
table = tx_news_domain_model_news
select.pidInList = 156
renderObj = COA
renderObj {
10 = TEXT
10.field = title
20 = TEXT
20.value = |
30 = TEXT
30.field = uid
stdWrap.wrap = |[\n]
}
}
... but how can I pre-select the select with the specific job record id when clicking on the 'Application' button?
Edit:
... I used js and localStorage as a workaround ... it works but only for one language. If I'm on the application form and switch languages ... the options in the select have a different uid and subsequently the select is unselected
$('.btn-apply').on('click', function() {
localStorage.setItem("varJobID", jobID);
});
$('#powermail_field_jobs, #powermail_field_job').val(localStorage.getItem('varJobID'));