howard-moore Posted March 11, 2010 Share Posted March 11, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/194928-popup-to-form-help/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.