1. <apex:commandLink value="Click Me" onClick="return JSMethod();" rerender="idTextBox"/>
2. <apex:inputText value="{!xyz}" id="newValueId"/> (New Value from User)
3. <apex:inputText value="{!abc}" id="idTextBox"/> (Text box whose value you want to change)
4. <script>
function JSMethod()
{
var newValue = document.getElementById('{!$Component.newValueId}').value;
document.getElementById('{!$Component.idTextBox}').value = newValue;
}
</script>
1. Use commandLink attribute, 'onClick'. 2. Call Javascript function onClick 3. Document.getElementById(TEXTBOXID).value = NEW VALUE. 4. Rerender that block containing text box.
1. <apex:commandLink value="Click Me" onClick="return JSMethod();" rerender="idTextBox"/>
2. <apex:inputText value="{!xyz}" id="newValueId"/> (New Value from User)
3. <apex:inputText value="{!abc}" id="idTextBox"/> (Text box whose value you want to change)
4. <script>
function JSMethod()
{
var newValue = document.getElementById('{!$Component.newValueId}').value;
document.getElementById('{!$Component.idTextBox}').value = newValue;
}
</script>
@krishna1,
Here is a rough idea on developing this:
All Answers
1. Use commandLink attribute, 'onClick'.
2. Call Javascript function onClick
3. Document.getElementById(TEXTBOXID).value = NEW VALUE.
4. Rerender that block containing text box.
Hi DeepaAnika,
Thank you for replay, Please give me one example, very usefull.
Thanks
@krishna1,
Here is a rough idea on developing this:
Thank you DeepaAnika