You need to sign in to do that
Don't have an account?

How can set value to apex:inputText from javascript?
<apex:form> <apex:inputText id="txtName" value="{!name}" label="Input"/> </apex:form>
<script> var txtName = document.getElementById('txtName'); txtName.value='abc'; </script>Occur error: Uncaught TypeError: Cannot set property 'value' of null
How can set value to apex:inputText from javascript?
You can use jQuery for this. In this case your code look like below:
Before using jQuery, you need to add jQuery.
Hope this will help you. Let me know if it helped or you need any more assistance.
Please mark this is as the solution if it solved your purpose.
Thanks,
Sohan Raj Gupta
All Answers
You can use jQuery for this. In this case your code look like below:
Before using jQuery, you need to add jQuery.
Hope this will help you. Let me know if it helped or you need any more assistance.
Please mark this is as the solution if it solved your purpose.
Thanks,
Sohan Raj Gupta
Your field ID will be changed on the basis of ORG. So you should class name instead of field ID.
Regards,
Sohan Raj Gupta
you need to add class attribute to access input text
, because id will be change on run time in browser. So you can use class.
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh