I’m writing a web application which includes a dialog box where the options are the names of people who work for a particular company; the names are kept on documents within the database. Only one name can be picked.
New names are added via a ‘new name’ button which uses a temporary field, then updates the dialog field/creates a new name document on save.
If the user changes the supplier I rebuild the name list via JavaScript [and thanks to this forum for info on this]. However I haven’t worked out how to remove the old names first, so at present if the new supplier has fewer names than the old I still show the extra names. It must be easy…?
P.S. There are always two dummy names so the list is never empty.
Thanks.
Subject: Deleting options from a dialog box on the web
Have you done a ‘Google’ search on this yet? This is not really a Notes problem but a Javascript challenge. So a Google search might give you faster success.I am sure you can delete options with Javascript.
Subject: RE: Deleting options from a dialog box on the web
Thank you VERY much; I posted it here as I’d found other useful Domino/javascript hints, but Googling ‘javascript select options delete’ popped up the answer at once - which is just to set the option to null.
Anne
Subject: RE: Deleting options from a dialog box on the web
A method that works (even though every standard says it shouldn’t, mustn’t, and that some deity will strike you down should you be arrogant enough to try) is to set the field’s options.length to 0.