I have a table where you can plan your vacation for each day. And you also have to select what type of day it is and for that i have radio buttons. But i want that if the 'staying' radio button is selected it shows another row as when the 'traveling'radio button is selected. And i have read other question about the if radio button is checked. But my script doesn't work and i don't know why. Here is the html:
<table class="table"align="center">
<tr class="nav_row" >
<th>Soort dag</th>
<th>Dag</th>
<th>Datum</th>
<th>Plaats</th>
<th>Verblijf naam</th>
<th>Type verblijf</th>
<th>Opmerkingen of andere dingen</th>
<th>Kosten</th>
</tr>
<tr>
<td><input id="verblijven1" type="radio" name="soort dag" value="op een plaats" checked> Aan het verblijven ( in bijv. hotel, camping enz.)<br><input id="reizen1" type="radio" name="soort dag" value="op reis" onclick="hideplaats1()"> Aan het reizen (bijv. vliegtuig, auto enz.)<br>
<input class="plan_button btn" type="button" onclick="dag1Function()" value="clear row"></td>
<td>1</td>
<form id="dag1plaats">
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><textarea rows="4" cols="35"></textarea></td>
<td><input type="text"></input>euro</td>
<form id="dag1reizen">
<td><input type="text"></input></td>
<td><label for="vertrek1">vertrek plaats</label>
<input id="vertrek1"type="text"></input></td>
<td><label for="typevervoer1">type vervoer</label
<input id="typevervoer1"type="text"></input></td>
<td><label for="aankomst1">aaknkomst plaats</label
<input id="aankomst1> type="text"></input></td>
<td><textarea rows="4" cols="35"></textarea></td>
<td><input type="text"></input>euro</td>
</form>
</tr>
<tr>
<td><form><input type="radio" name="soort dag" value="op een plaats" checked> Aan het verblijven ( in bijv. hotel, camping enz.)<br><input type="radio" name="soort dag" value="op reis"> Aan het reizen (bijv. vliegtuig, auto enz.)</form><br>
<input class="plan_button btn" type="button" onclick="dag2Function()" value="clear row"></td>
<td>2</td>
<form id="dag2">
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><textarea rows="4" cols="35"></textarea></td>
<td><input type="text"></input>euro</td>
</tr>
<tr>
<td><form><input type="radio" name="soort dag" value="op een plaats" checked> Aan het verblijven ( in bijv. hotel, camping enz.)<br><input type="radio" name="soort dag" value="op reis"> Aan het reizen (bijv. vliegtuig, auto enz.)</form><br>
<input class="plan_button btn" type="button" onclick="dag3Function()" value="clear row"></td>
<td>3</td>
<form id="dag3">
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><textarea rows="4" cols="35"></textarea></td>
<td><input type="text"></input>euro</td>
</tr>
<tr>
<td><form><input type="radio" name="soort dag" value="op een plaats" checked> Aan het verblijven ( in bijv. hotel, camping enz.)<br><input type="radio" name="soort dag" value="op reis"> Aan het reizen (bijv. vliegtuig, auto enz.)</form><br>
<input class="plan_button btn" type="button" onclick="dag4Function()" value="clear row"></td>
<td>4</td>
<form id="dag4">
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><textarea rows="4" cols="35"></textarea></td>
<td><input type="text"></input>euro</td>
</tr>
<tr>
<td><form><input type="radio" name="soort dag" value="op een plaats" checked> Aan het verblijven ( in bijv. hotel, camping enz.)<br><input type="radio" name="soort dag" value="op reis"> Aan het reizen (bijv. vliegtuig, auto enz.)</form><br>
<input class="plan_button btn" type="button" onclick="dag5Function()" value="clear row"></td>
<td>5</td>
<form id="dag5">
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><textarea rows="4" cols="35"></textarea></td>
<td><input type="text"></input>euro</td>
</tr>
<tr>
<td><form><input type="radio" name="soort dag" value="op een plaats" checked> Aan het verblijven ( in bijv. hotel, camping enz.)<br><input type="radio" name="soort dag" value="op reis"> Aan het reizen (bijv. vliegtuig, auto enz.)</form><br>
<input class="plan_button btn" type="button" onclick="dag6Function()" value="clear row"></td>
<td>6</td>
<form id="dag6">
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><textarea rows="4" cols="35"></textarea></td>
<td><input type="text"></input>euro</td>
</tr>
<tr>
<td><form><input type="radio" name="soort dag" value="op een plaats" checked> Aan het verblijven ( in bijv. hotel, camping enz.)<br><input type="radio" name="soort dag" value="op reis"> Aan het reizen (bijv. vliegtuig, auto enz.)</form><br>
<input class="plan_button btn" type="button" onclick="dag7Function()" value="clear row"></td>
<td>7</td>
<form id="dag7">
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><textarea rows="4" cols="35"></textarea></td>
<td><input type="text"></input>euro</td>
</tr>
</table>
I have also a clear row button to clear de imput of a day. This works fine if i don't have the other script for de radio button. But when i have the two scripts the clear button don't works anymore. I have the script now only for one day. But when the script works each day needs a radio button script. But for now only day one. Here is my script:
function dag1Function() {
document.getElementById("dag1").reset();
}
function dag2Function() {
document.getElementById("dag2").reset();
}
function dag3Function() {
document.getElementById("dag3").reset();
}
function dag4Function() {
document.getElementById("dag4").reset();
}
function dag5Function() {
document.getElementById("dag5").reset();
}
function dag6Function() {
document.getElementById("dag6").reset();
}
function dag7Function() {
document.getElementById("dag7").reset();
}
$(document).ready(function 12345(){
if($('#verblijven1').is(':checked')) {
$("#dag1plaats").show();
}
else { $("#dag1plaats").hide();
)}
}
$(document).ready(function 1234(){
if($('#reizen1').is(':checked')) {
$("#dag1reizen").show();
}
else {$("#dag1reizen").hide();
}
)}
so mu question is why doesn't the clear day button work when i have the other script and why does the radiobutton script not work