No that's not it, but thanks anyway.
I'll post all the necessary code down below. I am not going to post all code, cause that's more than 700 lines of HTML-code alone.
HTML
Code:
<form name="personalia" action="personalia.htm" method="post" enctype="text/plain">
<div class="antw"><input type="radio" name="geslacht" value="m" id="geslacht_m" onchange="personalia_showform();"/><label for="geslacht_m">Man</label></div>
<div class="antw"><input type="radio" name="geslacht" value="v" id="geslacht_v" onchange="personalia_showform();"/><label for="geslacht_v">Vrouw</label></div>
<div class="antw"><input type="radio" name="geslacht" value="st_mv" id="geslacht_mv" onchange="personalia_showform();"/><label for="geslacht_mv">Man/Vrouw-stel</label></div>
<div class="antw"><input type="radio" name="geslacht" value="st_vv" id="geslacht_vv" onchange="personalia_showform();"/> <label for="geslacht_vv">Vrouw/Vrouw-stel</label></div>
<div class="antw"><input type="radio" name="geslacht" value="st_mm" id="geslacht_mm" onchange="personalia_showform();"/><label for="geslacht_mm">Man/Man-stel</label></div>
<input type="submit" value="Bewaren" onclick="formulier_controle_personalia();" onkeypress="formulier_controle_personalia();">
</form>
The function personalia_showform() let's me show another set of questions that's related to the gender of the person, so that's not the code that needs to be altered.
The function formulier_controle_personalia() is the function that has the declaration of the variables. And the id from the radio button is necessary for the <label> part.
Javascript:
Code:
function formulier_controle_personalia()
{
var pers_gesl = document.personalia.geslacht.value;
alert("Personalia wordt gecontroleerd!\npers_gesl: " +pers_gesl)
}
Bookmarks