I have received an email script from my hosting provider that I need to customize. My goal is to extract the value of radio buttons in a group, and based on their id determine the subject line of the email. If the id is small, the subject should be "företag", or if it's large, then the subject should be "Sök jobb hos oss".
Here is the script for the email form:
<form method="post" action="http://www.something.se/cgi-bin/FormMail.pl"
accept-charset="ISO-8859-1" onsubmit="var originalCharset= document.charset;
document.charset= 'ISO-8859-1';
window.onbeforeunload= function () {document.charset=originalCharset;};" class="form">
<div class="u-margin-bottom-medium">
<a name="section-book"></a>
<h2 class="heading-secondary">
kontakta oss
</h2>
</div>
<!-- More form input fields here -->
</form>
Is there a way to modify this part:
<input type="hidden" name="subject" value="Subject" />
to dynamically set the subject based on the selected radio button using JavaScript?