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

Re: Connection Manager submit opens new window

Expand Messages
  • mitchevd
    Thanks Jon, that solved the problem :) ... information intended only for the named addressee(s). If you are not an intended recipient, do not read, copy,
    Message 1 of 7 , Sep 5, 2006
    • 0 Attachment
      Thanks Jon, that solved the problem :)

      --- In ydn-javascript@yahoogroups.com, "Whitcraft, Jon"
      <jwhitcraft@...> wrote:
      >
      > I'm going to go out on a limb and say that the problem is your action is
      > calling a JavaScript function so it's causing the browser to open a new
      > window.
      >
      >
      >
      > What you should do is use the onsubmit feature of the form tag and have
      > it like this:
      >
      >
      >
      > <form id="file-upload-form" enctype="multipart/form-data"
      > method="post" action="" onsubmit="Upload_file(); return false;">
      >
      >
      >
      > The reason you need the return false is so that it doesn't submit the
      > form with no action.
      >
      >
      >
      > Let me know if that helps.
      >
      >
      >
      > <http://zend.com/zce.php?c=ZEND002524&r=212822110>
      >
      > Jon Whitcraft
      > Indianapolis Motor Speedway
      > jwhitcraft@...
      >
      > Phone: (317) 492-8623 :: Fax: (317) 492-6419
      >
      >
      >
      > ________________________________
      >
      > From: ydn-javascript@yahoogroups.com
      > [mailto:ydn-javascript@yahoogroups.com] On Behalf Of mitchevd
      > Sent: Tuesday, September 05, 2006 4:02 PM
      > To: ydn-javascript@yahoogroups.com
      > Subject: [ydn-javascript] Re: Connection Manager submit opens new window
      >
      >
      >
      > Here is the form:
      >
      > <form id="file-upload-form" enctype="multipart/form-data"
      > method="post" action="Upload_file()">
      > <input type="hidden" id="file-id" name="file-id" value="-1">
      > File: <input type="file" id="userFile" name="userFile"><br>
      > <input type="submit" name="uploadFile" value="Upload file">
      > <br><br>
      > </form>
      >
      > and here is the Javascript again:
      >
      > function Upload_file(){
      >
      > var formObject = document.getElementById("file-upload-form");
      >
      > YAHOO.util.Connect.setForm(formObject, true);
      >
      > var cObj = YAHOO.util.Connect.asyncRequest('POST', 'file_upload.php',
      > callback);
      >
      > }
      >
      > This and the previous code are the only things involved here.
      > Currently the javascript posts to a php file, although it used to post
      > to a java servlet before. The problem occured then and happens now
      > which only leads me to conclude it is html/javascript related.
      > ********************
      > ********************
      > This E-mail (and attachments) may contain confidential/privileged
      information intended only for the named addressee(s). If you are not
      an intended recipient, do not read, copy, disseminate or take any
      action based on the content of this E-mail. Please notify the sender
      by reply E-mail and erase this E-mail from your system. Your
      assistance is appreciated. E-mail transmission may not be secure or
      error-free. The company is not responsible for any loss/damage arising
      from any virus transmitted.
      > ********************
      > ********************
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.