family type
、 、name
、 、 のgender
ようdate of birth
な子情報で構成されるページがありますcountry of birth
。
コード
<td colspan="2" class="title_all_u">Family Member 2 (Child)</td>
</tr>
<tr>
<td width="50%" class="pk">Family Type</td>
<td width="50%" class="pk_2"><input name="family_child_type" type="text" class="textfield_word" id="family_child_type" value="<?php echo $family_child_type ?>" /></td>
</tr>
<tr>
<td class="pk">Name</td>
<td width="50%" class="pk_2"><input name="family_child_name" type="text" class="textfield_word" id="family_child_name" value="<?php echo $family_child_name ?>" /></td>
</tr>
<tr>
<td class="pk">Gender Key</td>
<td class="pk_2">
<input type="radio" name="family_child_gender" id="family_child_gender" value="Male" <?php if ($family_child_gender=="Male"){ ?> checked <?php } ?>/>
Male
<input type="radio" name="family_child_gender" id="family_child_gender" value="Female" <?php if ($family_child_gender=="Female"){ ?> checked <?php } ?> />
Female
</td>
</tr>
<tr>
<td class="pk">Date of Birth</td>
<td class="pk_2"><input name="family_child_date_birth" type="text" class="tcal" id="family_child_date_birth" value="<?php echo date_create($family_child_date_birth)->format('d-m-Y');?>" readonly="readonly"/></td>
</tr>
<tr>
<td class="pk">Country of Birth</td>
<td class="pk_2">
<?php
$query = "SELECT country_type FROM country";
$result = mysql_query ($query); ?>
<select name="family_child_country" >
<?php while($row = mysql_fetch_array($result)){ ?>
<option value="<?php echo $row['country_type']?>" <?php if ( $family_child_country == $row['country_type']){ ?> selected <?php } ?>>
<?php echo $row['country_type']?></option>
<?php }?>
</select>
</td>
</tr>
<tr>
<td class="pk">Nationality</td>
<td class="pk_2">
<?php
$query = "SELECT nationality_type FROM nationality";
$result = mysql_query ($query); ?>
<select name="family_child_nationality" >
<?php while($row = mysql_fetch_array($result)){ ?>
<option value="<?php echo $row['nationality_type']?>" <?php if ( $family_child_nationality == $row['nationality_type']){ ?> selected <?php } ?>>
<?php echo $row['nationality_type']?></option>
<?php }?>
</select>
</td>
</tr>
<tr>
<td class="pk">IC Number</td>
<td width="50%" class="pk_2"><input name="family_child_ic_num" type="text" class="textfield_word" id="family_child_ic_num" value="<?php echo $family_child_ic_num ?>" /></td>
</tr>
<tr>
<td class="pk">Passport No.</td>
<td width="50%" class="pk_2"><input name="family_child_pass_num" type="text" class="textfield_word" id="family_child_pass_num" value="<?php echo $family_child_pass_num ?>" /></td>
</tr>
<tr>
<td class="pk">Education/Training</td>
<td width="50%" class="pk_2"><input name="family_child_education" type="text" class="textfield_word" id="family_child_education" value="<?php echo $family_child_education ?>" /></td>
</tr>
<tr>
<td class="pk">Handicapped</td>
<td width="50%" class="pk_2"><input name="family_child_handicaped" type="text" class="textfield_word" id="family_child_handicaped" value="<?php echo $family_child_handicaped ?>" /></td>
</tr>
<tr>
<td class="pk">Child Custody</td>
<td width="50%" class="pk_2"><input name="family_child_custody" type="text" class="textfield_word" id="family_child_custody" value="<?php echo $family_child_custody ?>" /></td>
</tr>
<tr>
<td class="pk">Married</td>
<td class="pk_2">
<input type="radio" name="family_child_married_status" id="family_child_married_status" value="Yes" <?php if ($family_child_married_status=="Yes"){ ?> checked <?php } ?>/>
Yes
<input type="radio" name="family_child_married_status" id="family_child_married_status" value="No" <?php if ($family_child_married_status=="No"){ ?> checked <?php } ?> />
No </td>
</tr>
<tr>
<td class="pk">Employed</td>
<td width="50%" class="pk_2"><input name="family_child_employed" type="text" class="textfield_word" id="family_child_employed" value="<?php echo $family_child_employed ?>" />
<input type="button" size="3" cols="30" value="Add Child" onClick="addNew()">
</td>
</tr>
<tr>
しかし、複数の子供がいる場合、2 番目または 3 番目の子供の情報を入力できる新しいフィールドを同じページ内に追加するにはどうすればよいですか?