0

Has anyone been able to get Help Texts working in a visualforce page with javascript present on the page. I think there is a bug that whenever i have jquery on my page, it fails to have any help text working. But if i break the javascript it starts working.

  • Can you clarify what you're doing with Javascript and maybe show some code? – Matt Lacey Mar 3 '14 at 21:36
1

I have a Visualforce page that uses jQuery and has help text displayed where I use apex:outputField.

The problem is presumably that your JavaScript is breaking (interfering with) the standard Salesforce JavaScript.

A basic step to lower the risk of this is to stop your jQuery from setting a value in $ as the Salesforce JavaScript code may be expecting that $ is assigned to something else. So always start with this:

<script src="path to your jQuery"/>
<script>
var j$ = jQuery.noConflict();
// Your code should now use j$ not $
</script>

Note these two pieces of script need to be right next to each other as shown because as soon as jQuery is referenced it overwrites $ and only when jQuery.noConflict() is executed is the value that was present before jQuery put back.

But it may be something else in your script that is the problem. If so you will have to narrow down the problem by commenting out parts of your JavaScript at a time.

  • Yeah it seems that it is indeed jquery and i have been using noconflict. – James Mar 3 '14 at 17:32
  • Just to be clear I am suggesting that it is in your code that the problem lies not jQuery or Salesforce. I also added a clarifying comment about the scripts needing to be next to each other in the answer. – Keith C Mar 3 '14 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.