How can I execute this:

From the dropdown list build up from mysql database (say a list of fruits).

I select "Add New Fruit". This triggers it to either have a modal form to add new fruit or a table form.

Once submitted, Select dropdown list RELOADS including the newly added data (fruit) without reloading the whole page which contains other form control such as textbox.

You can repopulate the combo box using Ajax or you can add new option element manually like follows:

yourSelectElement.options[yourSelectElement.length] = new Option('yourFruitText', 'yourFruitValue');
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.