1

I want to get a value from a field on the DispForm with jS / jQuery. I tried the following Code:

 var question =
 $('h3:contains("Frage")').closest('td').next('td').text();

However it doesn't work. jQuery is loaded and working with other features. The name of the column is correct aswell.

What am I doing wrong?

edit:

Hi,

1) I call it in a Script Webpart on the DispForm.aspx page.

2) I put the code at the bottom (so that it is the latest webpart) and it is still not working.

3) no errors in the development console

edit2:

Putting it in $(document).ready() worked! Thanks.

0

there is noting much to go by, but i will give it a shot!

1) where are you calling the JS function? is it on page load or on click.. can you show that code or explain that part?

2) try and put the JS code at the bottom of the page or called at the bottom so its the last in the stack to fire.

3) run f12 developer (within ie tools or press F12 key), first check for any jquery errors within the javascript console if not you can put in the code into the javascript console text editor.

if the above works than its how your calling the jquery code is the issue and number 1 and 2 should solve your issue.. if not that post back the result in your question.

| improve this answer | |
  • edited my original post – Södy Aug 20 '14 at 10:00

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.