Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Uploadify + form = little problem
  • i have implemented uploadify on a form.
    It work very good but there is a little problem.
    The problem is that the form work only if you use the browse to insert an image. If i dont insert an image, i cannot trigger the action form because 'onAllComplete' : function() there is the submit for the form and if i dont insert an image..it never trigger.

    this is the code.

    <form id=\"someForm\" method=\"post\" enctype=\"multipart/form-data\" action=\"index2.php\">

    <input id=\"fileInput\" name=\"fileInput\" type=\"file\" value=\"\"/>

    <script type=\"text/javascript\">// <![CDATA[
    $(document).ready(function() {
    var i=0;
    var bello= new Array();

    $('#fileInput').uploadify({
    'uploader' : 'uploadify.swf',
    'script' : 'uploadify.php',
    'cancelImg' : 'cancel.png',
    'auto' : false,
    'multi' : true,
    'simUploadLimit': 1,
    'queueSizeLimit': 3,
    'folder' : '/uploadify/uploads',
    'fileDesc' : 'Formato non valido',
    'fileExt' : '*.jpg;*.jpeg;',

    'onComplete' : function(event,queueID,fileObj,response,data) {
    bello[i]= response;
    i++;
    // response return real changed name of the file
    },
    'onAllComplete' : function() {
    bello.toString();
    $('#hidden').val(bello);
    $('#someForm').submit();
    }
    });

    });
    // ]]></script>

    Titolo: <input id=\"titolo\" name=\"titolo\" size=\"60\" type=\"text\" value=\"\"/>
    <input id=\"hidden\" name=\"hidden\" type=\"hidden\" value=\"\"/>
    <input id=\"pulsante\" type=\"button\" value=\"Submit\" onclick=\"javascript:$('#fileInput').uploadifyUpload()\"/>



    There is a solution to trigger the form without upload image?

    P.S sorry for my english.
  • ok i have resolved my problem.
    Now my script work too if there's no image selected.

    i put code if you want interested to implement in your script.


    <script type=\"text/javascript\">
    var queueSize = 0;

    function startUpload(){
    if (queueSize == 0)
    $('#someForm').submit();
    else
    $('#fileInput').uploadifyUpload();
    }
    </script>
    <script type=\"text/javascript\">// <![CDATA[
    $(document).ready(function() {
    var i=0;
    var bello= new Array();

    $('#fileInput').uploadify({
    'uploader' : 'uploadify.swf',
    'script' : 'uploadify.php',
    'cancelImg' : 'cancel.png',
    'auto' : false,
    'multi' : true,
    'simUploadLimit': 1,
    'queueSizeLimit': 3,
    'folder' : '/uploadify/uploads',
    'fileDesc' : 'Formato non valido',
    'fileExt' : '*.jpg;*.jpeg;',

    'onCancel': function (a, b, c, d) {
    queueSize = d.fileCount;
    },
    'onSelectOnce': function (a, b) {
    queueSize = b.fileCount;
    },
    'onComplete' : function(event,queueID,fileObj,response,data) {
    bello[i]= response;
    i++;
    queueSize--;
    },
    'onAllComplete' : function() {
    queueSize = 0;
    bello.toString();
    $('#hidden').val(bello);
    $('#someForm').submit();

    }


    });


    });
    // ]]></script>


    <form id=\"someForm\" method=\"post\" enctype=\"multipart/form-data\" action=\"index2.php\">

    <input id=\"fileInput\" name=\"fileInput\" type=\"file\" value=\"\"/>
    <li><strong>Titolo:</strong><br />
    <input id=\"titolo\" name=\"titolo\" size=\"60\" type=\"text\" value=\"\"/>
    </li>
    <input id=\"hidden\" name=\"hidden\" type=\"hidden\" value=\"\"/>

    <input id=\"pulsante\" name=\"pulsante\" type=\"button\" value=\"Submit\" onclick=\"javascript:startUpload()\">

    </form>

  • Order Tory Burch Flats now to enjoy high discount and free shipping!All elegant Tory Burch Shoes in our website are in promotion now.Just order Tory Burch now.Free shipping and fast delivery.
  • Shop MBT Shoes,enjoy the extra 55% off,fast shipping and no tax.MBT Shoes Clearance are physiological footwear that have a positive effect on the entire body.MBT are new arrival here which give to our clients more healthy,active and happy life.
  • UGG Classic Tall Boots is a calf-height boot made from genuine twin-face sheepskin. Genuine fleece sock liner insures comfort and warmth. Soft foam insole covered in sheepskin
    ugg boots canada for the ultimate in comfort. Flexible and durable molded EVA outer sole assures an easy stride.
    Classic tall ugg boots Believe what you have seen. The
    UGG boots is a must-have addition to your UGG canada boots collection. Suprior quality! Low price! Fast shipping! What you can do is just click you mouse and order
    Ugg Boots Online!
    http://www.uggs-canada-boots.com/
  • The user and all related content has been deleted.
  • The user and all related content has been deleted.
  • 2011 new ghd straighteners sale discount price in australia,our ghd hair straightener sale 60% off and free shipping, ghd australia supply all kinds of 2011 new ghd for you!
  • The user and all related content has been deleted.
  • The user and all related content has been deleted.