Forums

ASP

This topic is locked

Pureuploader 2.09

Posted 28 Jan 2003 03:40:21
1
has voted
28 Jan 2003 03:40:21 jacque jd posted:
I am having the same problem a questions was posted before,"I am inserting a reccord to a database with five file fields. the user many not have five images. I tried to enter a default value in the database "blank.jpg" That is just a white square. but the upload form inserst a blank for the field that have no image file name. How do you establish a defult value if their is no file for the upload."

and applied this to my detail page "<IMG SRC="<% if Trim(rsTest.Fields.Item("Image".Value) = "" then Response.Write "default_image.gif" else Response.Write rsTest.Fields.Item("Image".Value %>" >"
But no luck Here is how my detail page look:

____________________________
<% If Not rsPics.EOF Or Not rsPics.BOF Then %>
<table border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td height="225" colspan="5" align="center" valign="middle"><font color="#333333"><a href="#"><img src="images/<%=(rsPics.Fields.Item("image1".Value)%>" name="imageLarge" width="300" height="225" border="0" id="imageLarge"></a></font></td>
</tr>
<tr>
<td width="7" align="center" valign="middle"><font color="#333333"><A HREF="#" target="_self"><img src="images/<%=(rsPics.Fields.Item("image1".Value)%>" name="image1" width="90" height="50" border="0" id="image1" onMouseOver="MM_swapImage('imageLarge','','images/<%=(rsPics.Fields.Item("image1".Value)%>',1)"></A></font></td>
<td width="7" align="center" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<%if rsPics.Fields.Item("IMAGE2".Value = "" Then %>
<%Else%>
</font><font color="#333333"><A HREF="#" target="_self"><img src="images/<%=(rsPics.Fields.Item("image2".Value)%>" name="image2" width="90" height="50" border="0" id="image2" onMouseOver="MM_swapImage('imageLarge','','images/<%=(rsPics.Fields.Item("image2".Value)%>',1)"></A></font><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<%End if%>
</font></td>
<td width="7" align="center" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<%if rsPics.Fields.Item("IMAGE3".Value = "" Then %>
<%Else%>
</font><font color="#333333"><A HREF="#" target="_self"><img src="images/<%=(rsPics.Fields.Item("image3".Value)%>" name="image3" width="90" height="50" border="0" id="image3" onMouseOver="MM_swapImage('imageLarge','','images/<%=(rsPics.Fields.Item("image3".Value)%>',1)"></A></font><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<%End if%>
</font></td>
<td width="7" align="center" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<%if rsPics.Fields.Item("IMAGE4".Value = "" Then %>
<%Else%>
</font><font color="#333333"><A HREF="#" target="_self"><img src="images/<%=(rsPics.Fields.Item("image4".Value)%>" name="image4" width="90" height="50" border="0" id="image4" onMouseOver="MM_swapImage('imageLarge','','images/<%=(rsPics.Fields.Item("image4".Value)%>',1)"></A></font><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<%End if%>
</font></td>
<td width="75" align="center" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<%if rsPics.Fields.Item("IMAGE4".Value = "" Then %>
<%Else%>
</font><font color="#333333"><A HREF="#" target="_self"><img src="images/<%=(rsPics.Fields.Item("image5".Value)%>" name="image5" width="90" height="50" border="0" id="image5" onMouseOver="MM_swapImage('imageLarge','','images/<%=(rsPics.Fields.Item("image5".Value)%>',1)"></A></font><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<%End if%>
</font></td>
</tr>
</table>
<% End If ' end Not rsPics.EOF Or NOT rsPics.BOF %> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"> 
</font><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> 
</font> <div align="center">
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<% If rsPics.EOF And rsPics.BOF Then %>
<img src="images/nopic.jpg" width="150" height="100">
<% End If ' end rsPics.EOF And rsPics.BOF %>

Thank you

Replies

Replied 28 Jan 2003 09:31:59
28 Jan 2003 09:31:59 Martha Graham replied:
Check this FAQ:
www.dmxzone.com/go?2850

Martha Graham
DMXzone.com
Replied 28 Jan 2003 23:54:20
28 Jan 2003 23:54:20 jacque jd replied:
is it possible to add a radio button, that will have " No image" and can insert the value to database, nopic.jpg
Thank you

Reply to this topic