Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

repopulating dropdown box 1

Status
Not open for further replies.

apple17

Programmer
Jul 5, 2005
46
US
I have a dropdown box that shows all Series that a Program can belong to. It is populated from an Access table when the page is displayed. The idea is that the user selects the Series OR can press 'add new series'. When the user selects 'add new series', a new window pops up and the user adds his series. This all works great.

BUT now I need to refresh the list of Series in the dropdown to include the new Series.

I don't know where to begin. Does the user need to refresh the screen, thereby losing all the other data that has been entered. I would really like to automatically update the list.

Thanks
 
An easy (well, relatively) solution would be to have a javascript function in your main page that changes your form action to submit the page back to itself (which will then redisplay everything and fill in any form values that were passed along, keeping the values they already entered while updating the dropdown). Then what you would want to do is in the second page of the popup window (the one that actually submits the new entry to DB) you would use some javascript in the OnLoad to call parent.YourFunction() to call back to the original page and call the resubmission function.

So basically:
1) Change your form inputs to set their values to a passed value if one exists
2) Add a javascript function to change the FormName.action address to the same page and call FormName.submit() to submit the form back to itself
3) Add an Onload event to the popup's second page that calls the javascript function in the original page by using the parent keyword/reference.

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top