You need to sign in to do that
Don't have an account?
Raj.....
i want to use jquery validation plugin in salesforce
i want to use jquery validation plugin in salesforce.
i name the id in salesforce but when it comes to html the id is changed.
exmp:
id="uname"
id="j_id0:login:uname"
pls help me to solve this problem i am not geting the out put
On compilation Visualforce page generates HTML which contains ID of VF component in a hierarchy fashion. Find below a sample code :
<apex:page>
<apex:form>
<apex:inputtext id="Utext" value="{!uname}"/>
</apex:form>
<script>
alert(document.getElementById('pageid:formid:Utext').value);
</script>
</apex:page>
Note: PageId refers the Page id and formid refers the Form id.
All Answers
You can get at the generated id using the $Component global variable.
This is documented in detail at:
http://www.salesforce.com/us/developer/docs/pages/Content/pages_variables_global.htm
On compilation Visualforce page generates HTML which contains ID of VF component in a hierarchy fashion. Find below a sample code :
<apex:page>
<apex:form>
<apex:inputtext id="Utext" value="{!uname}"/>
</apex:form>
<script>
alert(document.getElementById('pageid:formid:Utext').value);
</script>
</apex:page>
Note: PageId refers the Page id and formid refers the Form id.
Hi.
I'm not sure if this is still an issue, but the answers provided don't help.
I recently started using jQuery for VF pages, and here's what you need to do.
First, since Salesforce uses the dollar sign for other things, you have to set a variable as noConflict, like this:
What we did in our org was create a component that contained the resource and this variable declaration; here's the complete code for that component:
Now to reference jQuery on a page, we just add this:
Anyway, getting back to your issue.
If your Id is "thePage:theForm:thepb:thepbs:inputFirstName" then do this:
where "event" is the event you want to happen.
You can also do searches for Ids using *, and using ^ searches for Ids that start with whatever is after the equal sign. However, since the ending part of the Id is what's unique, the $ is what you'll use most.
Also, another trick: to not have to worry about always typing the j$ rather than just $, do this for your .ready event:
Passing the dollar sign as an argument for the function means you can now do