Below is the sample code(I wrote it randomly). oncomplete of the actionfunction, javascript is being called, but the picklist value is being "undefined". I even tried $component.id, but the picklist value is still being "undefined". Any help is much appreciated. Thanks.
<apex:form id="the form">
<apex:pageblocksectionItem>
<apex:outputlabel> hi </apex:outputlabel>
<apex:actionregion>
<apex:inputfield value="{!picklist}" onchange="change();"/>
</apex:actionregion>
</apex:pageblocksectionItem>
<apex:actionfunction name="change" action={!apexmethod} rerender="theForm" oncomplete"callscript()" />
</apex:form>
<script>
function script()
{
if(picklist == 'yes')
{
alert ('random info');
}
}
</script>