hey guys.
I have a form (very much simplified):
<form method="post" action="add_contact.php">
<label>House No. :</label><input type="text" name="houseno" required />
<label>Street Name :</label><input type="text" name="street" required />
<lable>Spouse ?</lable><input type="radio" id="spouse-yes" onclick="FillSpouse(this.form)">Yes<input type="radio" id="spouse-no">
<label>House No. :</label><input type="text" name="spousehouseno" required />
<label>Street Name :</label><input type="text" name="spousestreet" required />
</form>
what i want is for when radion button "Yes" is clicked the two other text fields(name="spousehouseno" and name="spousestreet") will be populated by the same input values in the text fields(name="houseno" and name="street").
ive tried using from Click Here:
<script type="text/javascript">
function FillSpouse(f) {
if(f.spouse-yes.checked == true) {
f.houseno.value = f.spousehouseno.value;
f.street.value = f.spousestreet.value;
}
}
</script>
is there something wrong with this script?