You need to sign in to do that
Don't have an account?
S_Lie
JQuery and Visualforce Component
Hi,
I'm trying to connect JQuery with Visualforce component ( eg. Apex:InputText ), but not able to get ID in VF component to use in the JQuery function.
Please help!
Thanks
You need two things: the dom id of the vf control:
<script type="text/javascript">var userIdAuditId = jq('{!$Component.userIdAudit}');</script>
and a function to clean up the special characters in the visualforce generated id's:
<script type="text/javascript">
var j = jQuery.noConflict();
function jq(myid)
{
return '#' + myid.replace(/(:|\.)/g,'\\\$1');
}
</script>
The script above also sets Jquery into the noConflict mode. You need this as well.
HTH,
Rich C.
Hi ,
Thanks for your reply
For example :
<apex:form id="FormV">
<apex:pageBlock id="BlockV" >
<apex:pageBlockSection id="SectionV" >
<apex:inputText id="target"/>
<a href="" id="OkB">Click Here!</a>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
how to define the inputText id ?