Set a field to invisible through script.

Discussions about Forms Designer for SharePoint 2010.
Locked
Mario
Posts: 6
Joined: Sat Nov 17, 2012

03 Jul 2013

Hello Forum,

Does anyone know how to set a field to invisible through script?

The following code does not work :
fd.field('V3Comments').control().style.visibility = "hidden";

Kind regards,
Mario

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

03 Jul 2013

Hello Mario,

Please, try the following code instead:

Code: Select all

$('.fd_field[fd_name="V3Comments"]').hide();

Mario
Posts: 6
Joined: Sat Nov 17, 2012

17 Jul 2013

Hello Forum,

We managed to set the visibility based on another fields value in the new/edit forms. But this does not seem to work in the display form.
Question: does anyone know how to get a value from a choice field in the display form?

Code used in the new/edit form:

window.$(document).ready(function() {
if(fd.field('NameChoiceField').control().value() != "Ja"){
window.$('.my-Table').hide();
}

So this line does not seem to work in the display form: fd.field('NameChoiceField').control().value()

Kind reards,
Mario

Mario
Posts: 6
Joined: Sat Nov 17, 2012

17 Jul 2013

Update: I managed to get the field value using the following code:
window.$('div:contains("NameChoiceField")').closest('div').next('div').text()

Please advise if this is the correct way.

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

18 Jul 2013

Hello Mario,

Try the following code:

Code: Select all

fd.field('Choice').control()._el().text()

User avatar
Geir Mathisen
Posts: 16
Joined: Sun Dec 22, 2013

20 Jan 2014

What is the syntax to make the field visable again?

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

21 Jan 2014

Hello,

Please, try the following code:

Code: Select all

$('.fd_field[fd_name="V3Comments"]').show();

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests