Problems of Inherit form in a Table

Hi there,

I am thinking to add in one more detail into a personal information column and I having troubles when I try to insert a form into a <tr /tr>. I want to create a column to existing table for photo uploading.

This is my initial code:


<tr bgcolor="#FF9999">
<td height="22" colspan="3"><strong style="color: #FFF; font-size: 13px;">&nbsp;Personal Information</strong></td>
<tr bgcolor="#FFCCCC">
<td width="166" height="21"><strong>&nbsp;&nbsp;Name</strong></td>
<td width="12" height="21"><strong>:</strong></td>
<td width="640" height="21">
<strong id="sprytextfield1">
<label>
<input style="color: #009; font-family: Verdana, Geneva, sans-serif; font-size: 11px;" name="student_name" type="text" id="student_name" value="<?php echo $row_student['student_name']; ?>" size="40" maxlength="100" />
</label>
</strong>
</strong>
<strong style="color: #F00; font-size: 10px;">*</strong><strong class="style27 style25" style="color: #999; font-size: 10px"> eg: Sarimah Binti Abdul Rahim</strong>
</td>
</tr>
<tr bgcolor="#FFCCCC">
<td width="166" height="21"><strong>&nbsp;&nbsp;IC No</strong></td>
<td width="12" height="21"><strong>:</strong></td>
<td width="640" height="21">
<strong id="sprytextfield2">

This is the edited codes:


<!-- Personal Information -->
<tr bgcolor="#FF9999">
<td height="22" colspan="3"><strong style="color: #FFF; font-size: 13px;">&nbsp;Personal Information</strong></td>
<tr bgcolor="#FFCCCC">
  <td width="166" height="21"><strong>&nbsp;&nbsp;Photo</strong></td>
  <td width="12" height="21"><strong>:</strong></td>
  <td height="21"><FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD=POST>
Upload this file: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File"></FORM></td>
</tr>
<tr bgcolor="#FFCCCC">
<td width="166" height="21"><strong>&nbsp;&nbsp;Name</strong></td>
<td width="12" height="21"><strong>:</strong></td>
<td width="640" height="21">
<strong id="sprytextfield1">
<label>
<input style="color: #009; font-family: Verdana, Geneva, sans-serif; font-size: 11px;" name="student_name" type="text" id="student_name" value="<?php echo $row_student['student_name']; ?>" size="40" maxlength="100" />
</label>
</strong>
</strong>
<strong style="color: #F00; font-size: 10px;">*</strong><strong class="style27 style25" style="color: #999; font-size: 10px"> eg: Sarimah Binti Abdul Rahim</strong>
</td>
</tr>
<tr bgcolor="#FFCCCC">
<td width="166" height="21"><strong>&nbsp;&nbsp;IC No</strong></td>
<td width="12" height="21"><strong>:</strong></td>
<td width="640" height="21">
<strong id="sprytextfield2">

I added


<FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD=POST>
Upload this file: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File"></FORM>

into the “initial code” to form " edited code and the whole table being distorted. My purpose is to add a function for user to upload their profile photo, any other way I can try to do this?

Do one thing at a time.

a) Get your form working as it should (this is largely a PHP question then)
b) put the form elements into a table (this is largely a HTML question)

then eventually …
c) realise you should stop using tables except for displaying tabular data :wink:

Divide and conquer.