i need to know how to keep the states of each dynamically created dropdowns via jquery.
My scenario is like this, i have an option to user to select a date and based on selected date a dropdown is generated. lets say user generated 2 dats and below 2 dropdowns are dynamically generated with the help of jquery.
<select id="dd1">
<option value="option1">option 1</option>
<option value="option2">option 2</option>
<option value="option3">option 3</option>
</select>
<select id="dd2">
<option value="option5">option 5</option>
<option value="option8">option 8</option>
<option value="option9">option 9</option>
</select>
What i am concerned about is, since these are dyamically created ones i need to keep the same when a form is submitted with erros. so i have done that part but i cannot understand how to get the previously selected values when form/page is submitted with errors ?
for example, in dd, if user has selected option 1 and when the form is submitted with erros it should generate the same dropdown and select it the last selected value which is option 1 for dd1
any quickly reply is highly appreciated. its a store stopper now.
My yii code is like below.
<?php echo CHtml::activeLabelEx($cssAtapsClient, 'outgoing_call_dates'); ?>
And there is a calender in a popup which sets the value of above text box and loads the dynamic dropdowns as highlighted.

Each dynamically added dropdown has a naming convention like below. (select name='CSSAtapsClient[client_time_window][0]')
CSSAtapsClient[client_time_window][0]
CSSAtapsClient[client_time_window][1]
CSSAtapsClient[client_time_window][2]
CSSAtapsClient[client_time_window][3]
Wondering how to save the data via PHP ?