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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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.