function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aswin B SAswin B S 

Accessing value from custom component in javascript of vf page

Hi,

I have a custom component which provides lookup records based on the value entered. It is used in vf page inside a form. How can I fetch the value selected in the custom controller in my vf page javascript as soon as a value is selected.

Thanks

Here is the outline of code
<apex:page>
<script> Need the value here </script>
<c:customComponent/>
</apex:page>
ShirishaShirisha (Salesforce Developers) 
Hi Aswin,

Greetings!

Please find the example code in the below thread to refer the field from the Component.

https://salesforce.stackexchange.com/questions/32162/how-do-i-pass-a-parameter-from-component-to-a-visualforce-page

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Aswin B SAswin B S

Hi Shirisha,

Thanks for sharing the code. But the example code shows how to pass a value to the component. My page and component uses different controller. I am looking a way to pass a value from component to the controller of my page.

Thanks,
Aswin

asdag sdfrasdag sdfr
I'm facing the same problem in my account. Thanks for asking it I have applyeid the above code in my blog (https://bowsguide.com/best-bow-string-stop/) and its working fine now.