I have an input box and I would like it to call a function whenever the value is changed, is that possible? I have tried:
<div class="slds-form-element__control" id="annn">
<apex:form ><apex:actionfunction name="onchangemethod" action="{!valueupdate}" rerender="annn"></apex:actionfunction>
<input type="text" id="InptAnnVol" class="slds-input" value="{!InptAnnVol}" onchange="onchangemethod()"/></apex:form>
</div>
Controller:
public void valueupdate(){
decimal test;
test = decimal.valueof(InptAnnVol);
InptAnnvol = test.format();
}
Best Answer
You need to call a action function when ever something changes in the text field. You need to send that value to controller method using apex:param
VF:
Controller: