How to prioritize two change events in select element
<p>I have two change events handler for one select elemet. Let's call the functions Func1 and Func2. When I initialize these handlers I do the Func1 and then Func2 but when the change event happens in select element the Func2 get called before Func1.</p>

<p>Is there any way to prioritize this two functions. Just to let you know the initializations for each function is in different scripts.</p>

<p>This is the layout of my code</p>

<p>Script1:</p>

<pre><code>$("select#myDropdownlist").change(function(){
    $(this).parents('form:first').submit();
   // form submit sends post request to update an object which is in session
}
</code></pre>

<p>Script2:</p>

<pre><code>$("select#myDropdownlist").change(function(){
    Send an ajax request and return json result based on the changes happened to the object in script1 function
}
</code></pre>

<p>Although I initialized these by sequence it doesn't call the function in order. Because it calls Func2 first the object is not updated yet so result is not correct, it will then call Func1 and object will be updated which is too late as the Func2 has already returned the result based on previous version of object.</p>

<p>Please also note that Script1 is very generic and it's supposed to work for any form data entry page, where the Script2 is specific to a particular page and I want to do an extra thing once the select element is changed only in a page. This means I cannot call Func2 inside Func2.</p>

<p>Any help would be highly appreciated</p>

<p>Regards</p>

<p>Behnam Divsalar</p>
