I'm very new with JavaScript and I'm struggling to implement something which I don't think should be very complicated.
What I want to do is:
- form is open in browser with a drop-down list of records in a database
- if the desired option is not in the list, the user can click on a link next to it to add a new entry to the database
- this will open a new window with an additional form for this entry
- on clicking submit the processing script will run to insert this information into the database
- when the processing script has completed, the window will close and the drop-down list will refresh so that it includes the new option (but without losing any other information in the form)
Maybe that last thing with the list refreshing is quite complicated (unless the list only in fact loads from the db on click?) but everything else should be simple enough, I think. I've tried all sorts of things but nothing that's got close enough to working to be worth posting here.
Could someone please give me some sort of idea of the sort of functions I should be using and roughly how to implement them? I don't necessarily need precise code, just a framework to work from. (I'll learn more in that case anyway.)
ETA: I should add that I've been trying to work with window.open() and window.close(). I don't even really know if this is the best method?