Javascript running in Display forms

Discussions about Forms Designer for SharePoint 2010.
Locked
marcwenger
Posts: 17
Joined: Tue Dec 17, 2013

19 Dec 2013

In my new and edit forms, I have javascript to show/hide certain fields depending on another field's value. This appears not to work in the Display view, either because the script runs before the page is loaded, or the field is un-readable in the Display view. How do I get fields read in the Display form?

I put an alert(varname) in the script and when running in the display view it comes back as undefined. The same javascript works in New and Edit forms.


thanks!

-m

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

22 Dec 2013

Thank you for your question. You can get text representation of fields in Display form by using the following script:

Code: Select all

fd.field('InternalName').control()._el().text()
But If you want to make Display form dynamic based on field values, I recommend you to use Rules:
http://spform.com/documentation/groups

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests