porton
porton

Reputation: 5805

Updating list of <select> options dynamically

I work in Yii framework.

There is already done a form to edit person data.

Now we enter data for a contract about a pupil. Entering data about a pupil, we need among other to enter a list of his kins (parents and siblings).

The boss wants to add new items to <select> for a list of persons in the contract form without page reloading (in AJAX). That is he wants just to click "Add" button in the contract form and this button would open a form to enter data about a person (a kin of our pupil).

The question is how to implement it in a good (that is object oriented) way? There are already active forms to enter information about persons. What is the right way to "plug" a callback which updates the <select> in the contract form when we create a new person? Should this callback be called only if we open through the above mentioned "Add" button, or should it scan all open HTML windows and modify all "contract" pages (even if there is opened several contract pages)?

Upvotes: 0

Views: 151

Answers (1)

Telvin Nguyen
Telvin Nguyen

Reputation: 3559

I make a shot to show up how it should work

Yii Ajax Update

Upvotes: 1

Related Questions