Page 1 of 1

Set a field to invisible through script.

Posted: 03 Jul 2013
by Mario
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

Re: Set a field to invisible through script.

Posted: 03 Jul 2013
by Dmitry Kozlov
Hello Mario,

Please, try the following code instead:

Code: Select all

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

Re: Set a field to invisible through script.

Posted: 17 Jul 2013
by Mario
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

Re: Set a field to invisible through script.

Posted: 17 Jul 2013
by Mario
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.

Re: Set a field to invisible through script.

Posted: 18 Jul 2013
by Dmitry Kozlov
Hello Mario,

Try the following code:

Code: Select all

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

Re: Set a field to invisible through script.

Posted: 20 Jan 2014
by Geir Mathisen
What is the syntax to make the field visable again?

Re: Set a field to invisible through script.

Posted: 21 Jan 2014
by Dmitry Kozlov
Hello,

Please, try the following code:

Code: Select all

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