Loading ...
Sorry, an error occurred while loading the content.
 

File upload in dialog doesn't work

Expand Messages
  • Ken Loomis
    Hello: Is it a bug, a feature, or am I doing something wrong? I have a form with an input of file type in a YUI dialog. When I submit the form for uploading
    Message 1 of 5 , Mar 2, 2007
      Hello:

      Is it a bug, a feature, or am I doing something wrong? I have a form
      with an input of file type in a YUI dialog. When I submit the form for
      uploading using a submit button on the form (not one of the dynamically
      built buttons, and not using AJAX) the upload does not happen. If I pull
      the form off the dialog and put it on the page, the upload works. What's
      wrong?

      Thanks,

      Ken
    • tssha
      ... pull ... What s ... Please post a URL or sample code for us to review. Regards, Thomas
      Message 2 of 5 , Mar 2, 2007
        --- In ydn-javascript@yahoogroups.com, Ken Loomis <kloomis@...> wrote:
        >
        > Hello:
        >
        > Is it a bug, a feature, or am I doing something wrong? I have a form
        > with an input of file type in a YUI dialog. When I submit the form for
        > uploading using a submit button on the form (not one of the dynamically
        > built buttons, and not using AJAX) the upload does not happen. If I
        pull
        > the form off the dialog and put it on the page, the upload works.
        What's
        > wrong?
        >
        > Thanks,
        >
        > Ken

        Please post a URL or sample code for us to review.

        Regards,
        Thomas
      • dav.glass@yahoo.com
        Ken -- Can you put up an example somewhere so we can see it in action? Dav Dav Glass dav.glass@yahoo.com blog.davglass.com + Windows: n. - The most successful
        Message 3 of 5 , Mar 2, 2007
          Ken --

          Can you put up an example somewhere so we can see it in action?

          Dav
           
          Dav Glass
          dav.glass@...
          blog.davglass.com


          + Windows: n. - The most successful computer virus, ever. +
          + A computer without a Microsoft operating system is like a dog
          without bricks tied to its head +
          + A Microsoft Certified Systems Engineer is to computing what a
          McDonalds Certified Food Specialist is to fine cuisine +


          ----- Original Message ----
          From: Ken Loomis <kloomis@...>
          To: ydn-javascript@yahoogroups.com
          Sent: Friday, March 2, 2007 8:09:23 AM
          Subject: [ydn-javascript] File upload in dialog doesn't work

          Hello:

          Is it a bug, a feature, or am I doing something wrong? I have a form
          with an input of file type in a YUI dialog. When I submit the form for
          uploading using a submit button on the form (not one of the dynamically
          built buttons, and not using AJAX) the upload does not happen. If I pull
          the form off the dialog and put it on the page, the upload works. What's
          wrong?

          Thanks,

          Ken


          ------------------------ Yahoo! Groups Sponsor --------------------~-->
          Great things are happening at Yahoo! Groups.  See the new email design.
          http://us.click.yahoo.com/lOt0.A/hOaOAA/yQLSAA/edFolB/TM
          --------------------------------------------------------------------~->


          Yahoo! Groups Links

          <*> To visit your group on the web, go to:
              http://groups.yahoo.com/group/ydn-javascript/

          <*> Your email settings:
              Individual Email | Traditional

          <*> To change settings online go to:
              http://groups.yahoo.com/group/ydn-javascript/join
              (Yahoo! ID required)

          <*> To change settings via email:
              mailto:ydn-javascript-digest@yahoogroups.com
              mailto:ydn-javascript-fullfeatured@yahoogroups.com

          <*> To unsubscribe from this group, send an email to:
              ydn-javascript-unsubscribe@yahoogroups.com

          <*> Your use of Yahoo! Groups is subject to:
              http://docs.yahoo.com/info/terms/


        • Ken Loomis
          ... I m reluctant to post a URL since this is an upload script, but here s the code:
          Message 4 of 5 , Mar 2, 2007
            tssha wrote:
            > --- In ydn-javascript@yahoogroups.com, Ken Loomis <kloomis@...> wrote:
            >
            >> Hello:
            >>
            >> Is it a bug, a feature, or am I doing something wrong? I have a form
            >> with an input of file type in a YUI dialog. When I submit the form for
            >> uploading using a submit button on the form (not one of the dynamically
            >> built buttons, and not using AJAX) the upload does not happen. If I pull the form off the dialog and put it on the page, the upload works. What's wrong?
            >>
            > Please post a URL or sample code for us to review.
            I'm reluctant to post a URL since this is an upload script, but here's the code:


            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml" lang="ENG" xml:lang="ENGLISH">
            <head>
            <title>Upload Test</title>

            <style type="text/css"> @import url("pwstyle.css");</style>
            <script type="text/javascript"
            src="../yuilib/build/yahoo/yahoo.js"></script>
            <script type="text/javascript" src="../yuilib/build/dom/dom.js"></script>
            <script type="text/javascript"
            src="../yuilib/build/event/event.js"></script>
            <script type="text/javascript"
            src="../yuilib/build/container/container.js"></script>
            <link rel="stylesheet" type="text/css"
            href="../yuilib/build/container/assets/container.css">
            <link rel="stylesheet" type="text/css"
            href="../yuilib/build/fonts/fonts.css">
            <script type="text/javascript"
            src="../yuilib/build/connection/connection.js"></script>
            <script type="text/javascript"
            src="../yuilib/build/dragdrop/dragdrop.js"></script>
            <script type="text/javascript"
            src="../yuilib/build/animation/animation.js"></script>
            <script type="text/javascript">
            function init() {
            YAHOO.widget.dialogUploadFile = new YAHOO.widget.Dialog("dialogUpload",
            { width : "400px",
            fixedcenter : true,
            visible : false,
            constraintoviewport : true,
            buttons : [ { text:"Close", handler:handleCancel } ]
            } );

            YAHOO.widget.dialogUploadFile.render();
            }

            var handleCancel = function() {
            this.cancel();
            }

            YAHOO.util.Event.addListener(window, "load", init);

            function uploadFile() {
            YAHOO.widget.dialogUploadFile.show();
            }
            </script>
            </head>
            <body>

            <div id="functionButtons">
            <button onclick="uploadFile()">Upload file</button>
            </div>

            <div id="dialogUpload">
            <div class="hd">Upload file</div>
            <div class="bd">
            <form enctype="multipart/form-data" method="post"
            action="uploadTest.php" >
            <input type='file' name='fileName' ><br /><br />
            <input type='submit' value="Upload now">
            </form>
            </div>
            </div>

            </body>
            </html>
          • Ken Loomis
            Is it a bug, a feature, or am I doing something wrong? I have a form
            Message 5 of 5 , Mar 5, 2007
              Is it a bug, a feature, or am I doing something wrong? I have a form
              >>> with an input of file type in a YUI dialog. When I submit the form for
              >>> uploading using a submit button on the form (not one of the dynamically
              >>> built buttons, and not using AJAX) the upload does not happen. If I pull the form off the dialog and put it on the page, the upload works. What's wrong?
              >> Please post a URL or sample code for us to review.

              >> Here's the code:
              >>
              >>
              >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
              >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
              >> <html xmlns="http://www.w3.org/1999/xhtml" lang="ENG" xml:lang="ENGLISH">
              >> <head>
              >> <title>Upload Test</title>
              >>
              >> <style type="text/css"> @import url("pwstyle.css");</style>
              >> <script type="text/javascript"
              >> src="../yuilib/build/yahoo/yahoo.js"></script>
              >> <script type="text/javascript" src="../yuilib/build/dom/dom.js"></script>
              >> <script type="text/javascript"
              >> src="../yuilib/build/event/event.js"></script>
              >> <script type="text/javascript"
              >> src="../yuilib/build/container/container.js"></script>
              >> <link rel="stylesheet" type="text/css"
              >> href="../yuilib/build/container/assets/container.css">
              >> <link rel="stylesheet" type="text/css"
              >> href="../yuilib/build/fonts/fonts.css">
              >> <script type="text/javascript"
              >> src="../yuilib/build/connection/connection.js"></script>
              >> <script type="text/javascript"
              >> src="../yuilib/build/dragdrop/dragdrop.js"></script>
              >> <script type="text/javascript"
              >> src="../yuilib/build/animation/animation.js"></script>
              >> <script type="text/javascript">
              >> function init() {
              >> YAHOO.widget.dialogUploadFile = new YAHOO.widget.Dialog("dialogUpload",
              >> { width : "400px",
              >> fixedcenter : true,
              >> visible : false,
              >> constraintoviewport : true,
              >> buttons : [ { text:"Close", handler:handleCancel } ]
              >> } );
              >>
              >> YAHOO.widget.dialogUploadFile.render();
              >> }
              >>
              >> var handleCancel = function() {
              >> this.cancel();
              >> }
              >>
              >> YAHOO.util.Event.addListener(window, "load", init);
              >>
              >> function uploadFile() {
              >> YAHOO.widget.dialogUploadFile.show();
              >> }
              >> </script>
              >> </head>
              >> <body>
              >>
              >> <div id="functionButtons">
              >> <button onclick="uploadFile()">Upload file</button>
              >> </div>
              >>
              >> <div id="dialogUpload">
              >> <div class="hd">Upload file</div>
              >> <div class="bd">
              >> <form enctype="multipart/form-data" method="post"
              >> action="uploadTest.php" >
              >> <input type='file' name='fileName' ><br /><br />
              >> <input type='submit' value="Upload now">
              >> </form>
              >> </div>
              >> </div>
              >>
              >> </body>
              >> </html>
              >>
              >>
            Your message has been successfully submitted and would be delivered to recipients shortly.