Update the content of a select tag after new data been inserted

HI all, I have absolutely no experience with javascript; I never had a use for it until today.

I been happy using php and html to build my database front end but now faced with an update problem:

I have several dozens of forms that use select/option tags. I am at a point where a user may need to update the content of a select tag on the fly with another option. I have created the popup form and all that is needed to update the database but in order to show the latest addition to the select box I have to update the whole page in order for the query that populate the select tag be updated…

Everyone been telling me I need ajax to refresh the select tag. The problem that I have is I been searching for two nights for this elusive tutorial or example that would show me how to do that but unfortunately can only find examples of multiple ajax dynamic select boxes. There is no examples or mention anywhere that I could find where someone shows an ajax technic to update a “single” select box???

Any link to ajax tutorial would be much appreciated as I have ran out of options. I hate having to waste anyone’s time on such a simple thing. I’m only interested in learning how to update a select tag, nothing more. thanks a bunch in advance.

First (the obvious), each request goes to a file that returns something (typically JSON)

If you are already including jQuery the steps are different but not all that much less than without.

MAJOR requirement
ALL user supplied input needs to be processed - on the server-side
Do not rely on JavaScript for security.

(My apologies to those that don’t need to hear that, If you’ve never heard it, please read it again)

Thanks for replying.

I don’t use jquery or json either. Just php and html, that’s it.

edit: Yes I validate all my input and output fields in php. It’s not an issue, I have this down path pretty good.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.