Jump to content

Forms Windows and Populating Them


monkeytooth

Recommended Posts

No clue here javascript isn't fully my cup of tea.. anywho. I've seen it done, but don't know how to do it myself.

 

I am building a form, and have a couple links within it that pop up windows to help people figure certain questions out if they get stuck. But now I want to make it even more easier. I have 2 Input fields in particular that I want to attempt to populate from the popped up window. I have a standard one line text box that they can choose from a link what they want to put into the field should they choose a predefined answer for it. Then I also have a single select drop down input. With pre-existing answers already in it, but concidering the question for it some people will most likely choose the popup to help get there answer. ANd by clicking on that pop up I want it to select for them from the drop-down.

 

So I guess the question is how? Anyone?

Link to comment
Share on other sites

Yep. You can use whatever method you want to show content in the popup. I am writing it with javascript, but you can popup an existing page with the code that uses the "opener" reference. Basically, the only code you need to know is "opener.testBox.value" where testBox is the id of the input box. Of course, if it is in a form, you will have to use "opener.formid.testBox.value" or you can just use document.getElementById("testBox")

Link to comment
Share on other sites

So if i am understanding this right. On my main window that i click the link to create the pop up, where the form resides in the orginal window with the link. I would name the form. Then in the pop up where the links are that I want to populate the form input with. I just use the code you provided just changing the name vaulues in the code to match the name of the form and the input back on the main window?

 

Sorry this is a new concept to me, as far as using external windows for form populating. So I may come across with assinign questions

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.