Jump to content

Popup windows to fill a form


$username

Recommended Posts

Hello All,

    I am working on getting a form field filled by using a popup for the selection.

I am looking for code examples that work for opening a page than once an item is selected it will fill a field on a form.

 

so far I have the window to open but I do not understand how to get the info in to the form.

Its like how pop up calenders work. But with SQL data.

 

Hope this is understandable.

 

Brett

Link to comment
https://forums.phpfreaks.com/topic/116468-popup-windows-to-fill-a-form/
Share on other sites

since you're popping up the window using a link, there is a relationship there.  you can select elements inside the parent window (which is called exactly that in the DOM) and populate them from the child window the way you would with elements on the same page - you simply have to specify that you're pointing to the parent window rather than the child.

 

can't offer any specific code until you've shown us what you're using to pop open the window, the two forms, and the specifics of what data you want to put where.

Ok well due to me not knowing what I am looking for yet I cannot provide to much code.

 

But I think what I am looking for is something like this.

 

function __doPostBack(eventTarget, eventArgument) {

    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {

        theForm.__EVENTTARGET.value = eventTarget;

        theForm.__EVENTARGUMENT.value = eventArgument;

        theForm.submit();

    }

 

Example

 

Addinfo page

 

Please select the category

 

When you click it takes you to

 

selection page

 

where you have the links that you want to add to addinfo page

 

but how do I get the selection info passed back to addinfo field?

 

 

Thank you,

Brett

the same way you'd do it on the same webpage, only you need to specify the parent window:

 

opener.document.getElementById('fieldID').value = something.from.this.window;

 

this is entirely off the top of my head, keep in mind.  it may not work.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.