Jump to content

Popup to Form help


howard-moore

Recommended Posts

Hi All,

 

I have a form that I am using to post data to a MySQL database. It all works absolutely fine, except that I want to add a new field to it for uploaded files. Because some files may be too large or have the same names as existing files, I want to run this as a separate form in a popup window and then post the filename only back to the parent form.

 

I am using a bit of javascript so that when a user clicks in the document input field it opens a small popup window:

 

<input type="text" name="agenda" id="agenda" onclick="makeSelection(this.form, 'Agenda');" />

 

the js used is this:

 

targetElement = null;
    function makeSelection(myform, id) {
      if(!myform || !id)
        return;
      targetElement = myform.elements[id];
      var handle = window.open("../admin/file_upload_agenda.php",
"mywindow","menubar=0,resizable=0,width=300,height=100");
    }

 

Obviously the file called 'file_upload_agenda.php' is the one that has the upload form, and I can get the form to return a success result with the data I require embedded in another form (e.g. a 'save and continue' button etc.), but what I don't know how to do is to get the data of that final form to automatically post back to the parent page and go directly into the required input field.

 

So, to clarify / recap:

 

 

1. User clicks on field to enter document details.

 

2. Popup appears inviting user to locate file on local drive and upload.

 

3. Popup displays name of file that he been uploaded.

 

**** 4. I need a way of getting that name back to the parent page through a click of a button.

 

Looking forward responses!

 

Regards,

Neil

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.