File field validation
I would like to make a file field requires but the client side validation. The rule seems to ignore the content in the field. What am I doing wrong?
<form action="gallery_Insert.php" method="post" enctype="multipart/form-data" name="WADAInsertForm" id="WADAInsertForm" onsubmit="WAValidateRQ(document.WADAInsertForm.album_img,'Select Album',document.WADAInsertForm.album_img,0,true,'select');WAValidateAN(document.getElementById('WADAInsertForm').fileField,document.getElementById('WADAInsertForm').fileField.value,'Browse for an image file',true,true,true,true,'',document.getElementById('WADAInsertForm').fileField,0,true);WAAlertErrors('The following errors were found','Correct invalid entries to continue',true,document.getElementById('false'),false);return document.MM_returnValue">
<div class="WADAHeader">Insert Image</div>
<div class="WADAHorizLine"><img src="../../WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">ID key_img</th>
<td class="WADADataTableCell"></td>
</tr>
<tr>
<th class="WADADataTableHeader">Album</th>
<td class="WADADataTableCell"><label>
<select name="album_img" id="album_img">
<option value="">Select One</option>
<?php
do {
?>
<option value="<?php echo $row_rsAlbum['id_alb']?>"><?php echo $row_rsAlbum['title_alb']?></option>
<?php
} while ($row_rsAlbum = mysql_fetch_assoc($rsAlbum));
$rows = mysql_num_rows($rsAlbum);
if($rows > 0) {
mysql_data_seek($rsAlbum, 0);
$row_rsAlbum = mysql_fetch_assoc($rsAlbum);
}
?>
</select>
</label></td>
</tr>
<tr>
<th class="WADADataTableHeader">Filename</th>
<td class="WADADataTableCell"><input type="hidden" name="filename_img" id="filename_img" value="" size="32" />
<label>filename2
<input name="fileField" type="file" id="fileField" size="60" />
</label></td>
</tr>
<tr>
<th class="WADADataTableHeader">Caption</th>
<td class="WADADataTableCell"><input type="text" name="caption_img" id="caption_img" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Order</th>
<td class="WADADataTableCell"><input type="text" name="order_img" id="order_img" value="" size="4" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Icon</th>
<td class="WADADataTableCell"><input type="checkbox" name="alb_icon" id="alb_icon" value="1" />
click here if this is to be the icon for the album only one image should have this box checked!</td>
</tr>
</table>
<div class="WADAHorizLine"><img src="../../WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Insert" id="Insert" value="Insert" alt="Insert" src="../../WA_DataAssist/images/Pacifica/Refined_insert.gif" /></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="gallery_Results.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="../../WA_DataAssist/images/Pacifica/Refined_cancel.gif" /></a></td>
</tr>
</table>
<input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="" />
</div>
</form>