How to question: Added new values to dropdown lists & database

  • Thread starter Thread starter Chris Becker
  • Start date Start date
C

Chris Becker

This is my attempt to rephrase a question I asked earlier that got no
response. I suspect it was my poor/unplanned wording. Here is another
attempt:

I have a form with some drop down lists. I would like the user to be able
to start filling in the form, then get to one of the dropdown lists (ex:
Service Type) and realize that the dropdown list does not contain the entry
that they need. So next to the Service Type drop down list is a
link/image/button/whatever that they can click to bring up a new window ( or
???) to add that new Service Type item. When they save this new Service
Type item's information, it will be added to the database ServiceTypes table
in the db, the Add Service Type window will close, and the form that they
were originally filling out will be preserved, but refreshed to show the new
service type in the drop down list.

I'm not asking for exact code necessarily, just some general concepts/links
on how others have accomplished it. I am looking for a more elegant way
than saving each field's data into some temp storage and refreshing the
whole page to add the new service type item, then returning the user back to
the original form and re-filling all of the fields with the stored values.

Thanks
Chris
 
Sounds like you'll be needing to use some client side javascript.
You can open a new window using javascript such as this:
a=window.open('http://localhost/TestWebApp/Test.aspx','_new')
There are all kinds of options for setting window properties such as window
size and toolbar visibility.
Here's more info:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp

From that new window you can reference the original parent window with
thisjavascript reference:

window.opener

Here's more info on that:
http://www.mozilla.org/docs/dom/domref/dom_window_ref77.html
 
I like to keep that kind of stuff on the same page if I
can.

you can put the "add new thing" controls next to the drop
down, with visible set to false. Clicking the icon makes
it visible. They add the info, click the Add button in
that section, and you bind the drop-down to the table, now
with the new value.
 
Back
Top