I have 5 inputtext I want to add the value of all the inputtext to a outputtext. I dont want any action to be done on the button click. I need when the value of the 1st and 2nd inputtext is entered then it should get added, same as with 5 inputtext. I want it should work on value change of inputtext.
Attribution to: AnuRaj
Possible Suggestion/Solution #1
You may use Onchange event of the inputText to call an action function.
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_inputText.htm
Refer the above and call the action function on the Onchange event and refer the below document to understand how you can call action function by binding with Id of the component
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionFunction.htm
Attribution to: Mohith Shrivastava
Possible Suggestion/Solution #2
I would try it with jQuery:
<apex:inputField value="Object.Field__c" styleClass="inputField1">
...
<apex:outputText value="..." styleClass="outputField">
<script>
jQuery('.inputField1').change(function(){
jQuery('.outputField').val(jQuery(this).val());
});
</script>
Attribution to: Sergej Utko
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4887