DakotaChick
09-01-2006, 06:46 PM
I'm having an issue with a form determining if there is any information in a field of type File. If there is nothing in the field then i need to have the form submit its information to a different page than if it has something to upload.
Here's what I have. The error message it gives me is that the object doesnt support the method "submit" though I use this same method in another page with basicly the same code and it works just fine.
<!-- Conditional Statement -->
<script language="vbscript">
sub updatetype()
dim imgupload
imgupload= "<%=request.form("myFile")%>"
if imgupload <> "" then
update.action="update2b.asp"
else
update.action="update2a.asp"
end if
update.submit
end sub
</script>
<!-- Form Code here -->
<form name="update" method="POST" enctype="multipart/form-data">
<table width="74%" border="0" align="center">
<tr>
<td width="30%"><div align="right" class="style2">Neighborhood:</div></td>
<td width="16%">
<input name="Label" type="text" id="Label" size="15" tabindex="1" value="<%=(Listings.Fields.Item("Label").Value)%>" /> </td>
<td width="21%"><div align="right" class="style2">Full Bathrooms: </div></td>
<td width="33%" valign="middle">
<input name="FullBath" type="text" id="FullBath" size="15" tabindex="4" value="<%=(Listings.Fields.Item("FullBath").Value)%>" /> </td>
</tr>
<tr>
<td><div align="right" class="style2">Address:</div></td>
<td>
<input name="Address" type="text" id="Address" size="15" tabindex="2" value="<%=(Listings.Fields.Item("Address").Value)%>" /> </td>
<td><div align="right" class="style2">Half Bathrooms: </div></td>
<td valign="middle">
<input name="HalfBath" type="text" id="HalfBath" size="15" tabindex="5" value="<%=(Listings.Fields.Item("HalfBath").Value)%>" /> </td>
</tr>
<tr>
<td><div align="right" class="style2">Bedrooms:</div></td>
<td>
<input name="Bedrooms" type="text" id="Bedrooms" size="15" maxlength="2" tabindex="3" value="<%=(Listings.Fields.Item("Bedrooms").Value)%>" /> </td>
<td><div align="right" class="style2">List Price: </div></td>
<td valign="middle">
<input name="ListPrice" type="text" id="ListPrice" size="15" tabindex="6" value="<%=(Listings.Fields.Item("Price").Value)%>" /> </td>
</tr>
<tr >
<td > </td>
<td valign="middle"colspan="3">
<input name="MoreInfoLink" type="hidden" id="MoreInfoLink" size="50" tabindex="8" value="<%=(Listings.Fields.Item("MoreInfoLink").Value)%>" /></td>
</tr>
<tr>
<td align="right" valign="top" class="style2">Image Filename:</TD>
<td align="left" class="style2" colspan="3"><span class="style6">
<input type="file" name="myFile">
<br />
</span><span class="style12"><I>Click "Browse" to select a .jpg, .gif, or .bmp file to upload</I></span></TD>
</tr>
<tr>
<td colspan="4"><div align="center">
<input name="Submit" type="button" value="Update Listing" onclick=updatetype() /></div></td>
</table>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= Listings.Fields.Item("Label").Value %>">
<input type="hidden" name="MM_recordId" value="<%= Listings.Fields.Item("MoreInfoLink").Value %>">
</form>
Any help would be appreciated. Thanks.
Here's what I have. The error message it gives me is that the object doesnt support the method "submit" though I use this same method in another page with basicly the same code and it works just fine.
<!-- Conditional Statement -->
<script language="vbscript">
sub updatetype()
dim imgupload
imgupload= "<%=request.form("myFile")%>"
if imgupload <> "" then
update.action="update2b.asp"
else
update.action="update2a.asp"
end if
update.submit
end sub
</script>
<!-- Form Code here -->
<form name="update" method="POST" enctype="multipart/form-data">
<table width="74%" border="0" align="center">
<tr>
<td width="30%"><div align="right" class="style2">Neighborhood:</div></td>
<td width="16%">
<input name="Label" type="text" id="Label" size="15" tabindex="1" value="<%=(Listings.Fields.Item("Label").Value)%>" /> </td>
<td width="21%"><div align="right" class="style2">Full Bathrooms: </div></td>
<td width="33%" valign="middle">
<input name="FullBath" type="text" id="FullBath" size="15" tabindex="4" value="<%=(Listings.Fields.Item("FullBath").Value)%>" /> </td>
</tr>
<tr>
<td><div align="right" class="style2">Address:</div></td>
<td>
<input name="Address" type="text" id="Address" size="15" tabindex="2" value="<%=(Listings.Fields.Item("Address").Value)%>" /> </td>
<td><div align="right" class="style2">Half Bathrooms: </div></td>
<td valign="middle">
<input name="HalfBath" type="text" id="HalfBath" size="15" tabindex="5" value="<%=(Listings.Fields.Item("HalfBath").Value)%>" /> </td>
</tr>
<tr>
<td><div align="right" class="style2">Bedrooms:</div></td>
<td>
<input name="Bedrooms" type="text" id="Bedrooms" size="15" maxlength="2" tabindex="3" value="<%=(Listings.Fields.Item("Bedrooms").Value)%>" /> </td>
<td><div align="right" class="style2">List Price: </div></td>
<td valign="middle">
<input name="ListPrice" type="text" id="ListPrice" size="15" tabindex="6" value="<%=(Listings.Fields.Item("Price").Value)%>" /> </td>
</tr>
<tr >
<td > </td>
<td valign="middle"colspan="3">
<input name="MoreInfoLink" type="hidden" id="MoreInfoLink" size="50" tabindex="8" value="<%=(Listings.Fields.Item("MoreInfoLink").Value)%>" /></td>
</tr>
<tr>
<td align="right" valign="top" class="style2">Image Filename:</TD>
<td align="left" class="style2" colspan="3"><span class="style6">
<input type="file" name="myFile">
<br />
</span><span class="style12"><I>Click "Browse" to select a .jpg, .gif, or .bmp file to upload</I></span></TD>
</tr>
<tr>
<td colspan="4"><div align="center">
<input name="Submit" type="button" value="Update Listing" onclick=updatetype() /></div></td>
</table>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= Listings.Fields.Item("Label").Value %>">
<input type="hidden" name="MM_recordId" value="<%= Listings.Fields.Item("MoreInfoLink").Value %>">
</form>
Any help would be appreciated. Thanks.