0

I have a below drop down

<div class="col-xs-12 col-md-6 pull-right">
    <select id="ament1Status7" name="ament1Status7" onchange="changeAmtStatus(3, 1156,this.value, 'status1',7);"> 
        <option value="">Select status</option> 
        <option value="A" selected="selected">Approved</option> 
        <option value="R">Rejected</option> 
    </select>
    <div class="container-active" id="ament1Status7_chzn">
        <a class="chzn-single"><span>Approved</span></a>
        <ul class="chzn-results">
            <li class="active-result" data-option-array-index="0" style="">Select status</li>
            <li class="active-result  result-selected" data-option-array-index="1" style="">Approved</li>
            <li class="active-result" data-option-array-index="2" style="">Rejected</li>
        </ul>
</div>

In this dropdown value is shown to user is under span element in second div.

Currently, option value "A" is selected & span contains the text "Approved".

on dropdown 'onchange' function, a modal popup is opened. If I close the popup I want show previous value in span text.

e.g. Currently, option value "A" is selected & span contains the text "Approved". After selecting the option value "R" a span text is changed to "Rejected" & a new modal popup will open.

I have closed this popup without any action within that popup. It closes the popup without page reload & want to set previous option value fro dropdown to "A" from "R" and span text from "Rejected" to "Approved"

function changeAmtStatus(pid, id, StatusToChange, statusFlag, dropdownIdForStatus) 
{   
    document.getElementById('user_id').value = id; 
    document.getElementById('StatusToChange').value = StatusToChange; 
    jQuery("#modal").modal("show"); 
}

Note: This is not a single dropdown on a page. It executes within the loop.

0 Answers0