$username Posted July 24, 2008 Share Posted July 24, 2008 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 Quote Link to comment Share on other sites More sharing options...
akitchin Posted July 24, 2008 Share Posted July 24, 2008 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. Quote Link to comment Share on other sites More sharing options...
$username Posted July 24, 2008 Author Share Posted July 24, 2008 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 Quote Link to comment Share on other sites More sharing options...
akitchin Posted July 24, 2008 Share Posted July 24, 2008 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. Quote Link to comment 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.