Note that there are some explanatory texts on larger screens.

plurals
  1. POdelay javascript function until after file has been uploaded on asp page
    primarykey
    data
    text
    <p>Can someone please tell me how to delay the resetting of a div background-image until a file upload has completed? All the parts individually work, however I have to delay the setting of the background by having an alert pop up and then leave a while before clicking ok - I can't have since a user will not know how long to leave before pressing... Any help appreciated though I should say that I briefly looked at jquery/ajax but found that it would only work in IE once before requiing a page refresh </p> <p>Html...</p> <pre><code>&lt;iframe id="MyFrame" name="MyFrame" style="display:none;"&gt;&lt;/iframe&gt; &lt;form id="browseform" method="post" action="disp_photosave.asp" enctype="multipart/form-data" target="MyFrame"&gt; &lt;p&gt;Please select your photo...&lt;/p&gt; &lt;img src="Images/button_browse.gif"&gt; &lt;input type="hidden" name="tab" value="0"&gt; &lt;input type="file" id="upload" name="filesent" onchange="this.form.submit(); load_bk_photo()"&gt; &lt;input type="hidden" name="tempid" value="&lt;%=(TId)%&gt;"&gt; &lt;input type="hidden" name="side" value="&lt;%=(strSide)%&gt;"&gt; &lt;input type="hidden" name="varid" value="&lt;%=(Request.querystring("varid"))%&gt;"&gt; &lt;input type="hidden" name="prodid" value="&lt;%=(Request.querystring("prodid"))%&gt;"&gt; &lt;/form&gt; </code></pre> <p>javascript...</p> <pre><code>function load_bk_photo(){ var activeId = '&lt;%=(activeTempStoreId)%&gt;' var redStr_id = "side1" d = new Date(); time_temp = d.getTime(); photoUrl = "photos/merged_"+activeId+"_"+redStr_id+".png?"+d.getTime() alert ("timebbb = "+time_temp ) $('#resizable-img').css('background-image','url("' + photoUrl + '")'); $('#resizable-img').css('display','block'); } </code></pre> <p>vbscript on disp_photosave.asp...</p> <pre><code>&lt;% Set Upload = Server.CreateObject("csASPUpload.Process") Set Image = Server.CreateObject("csImageFile.Manage") prodid = prodSet.Fields.Item("id").Value redStr = "side1" fieldPrefix = "front_" If Upload.FileQty &gt; 0 Then Image.ReadVariant Upload.FileData(0) Image.WriteFile Server.MapPath("this works ok" Image.ResizeFit scale_width, scale_height Image.WriteFile Server.MapPath("this works ok" storeHeight = Image.Height storeWidth = Image.Width Set MyConn=Server.CreateObject("ADODB.Connection") MyConn.Open "dsn=xxx;uid=xxx;password=xxx;" SQLString = "this works ok" MyConn.Execute(SQLString) MyConn.Close Set MyConn = Nothing End if %&gt; </code></pre> <p>I also need to return the value storeHeight and storeWidth to the main page to use later so if anyone can advise me on that too.</p> <p>Thanks in advance for any help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload