Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I re-initialize Uploadify script without adding extra button?
    primarykey
    data
    text
    <p>I'm walking you through a processs here:</p> <p><strong>Step 1</strong><br> 1. Select product from dropdownlist<br> 2. A form is populated with data<br> 3. An hidden ID get's the product ID from the selected item<br> 4. Uploadify is initialized and retrieves the product ID. An uploadbutton is added to form.</p> <p><strong>Step 2</strong><br> 1. Select new product from dropdownlist<br> 2. The form is re-populated with data<br> 3. The hidden ID get's the new product ID from the selected item<br> 4. Uploadify is initialized and retrieves the product ID. A new uploadbutton is added to form.</p> <p>Now I'm stuck with two buttons. Not exactly what I want.</p> <p>I could check to see if the button is added and thus not re-initialize the button, but then the Uploadify script will not retrieve the new product ID (which I need for misc. stuff).</p> <p>Any ideas how I could solve this little issue?</p> <p>This is my uploadify function:</p> <pre><code>function initUploadify() { // If button is already added, do not add it again. // But this will not retrieve new productID. if( jQuery('#brand_btnBrowseLogoQueue').length &lt; 1) { jQuery('#txtBoxFileName').css({'position':'relative', 'top':'-9px'}); jQuery("#brand_btnBrowseLogo").uploadify({ 'uploader' : 'wp-content/plugins/uploadify/uploadify.swf', 'script' : 'wp-content/plugins/uploadify/uploadify.php', 'folder' : 'brand', 'fileExt' : '*.jpg;*.jpeg;*.png', 'auto' : true, 'multi' : false, 'method' : 'POST', 'height' : '30', 'width' : '100', 'buttonImg' : 'path/to/img/btn_browse_101x30px.png', 'scriptData' : {'productID':jQuery("#productID").val()}, onComplete : function(event, queueID, fileObj, response, data) { //This makes the json response readable data = eval("(" + response + ")"); //Update logo image setLogo(jQuery("#brandID").val(),data.fileName); } }); } } </code></pre>
    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.
    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