Set a field to invisible through script.

rss

Posted by Mario - Jul 3 ’13 at 07:09

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

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 6 months 4 days
    #1 by Dmitry Jul 3 ’13 at 11:37

    Hello Mario,

    Please, try the following code instead:

    $('.fd_field[fd_name="V3Comments"]').hide();
    
  • Mario
    Member
    Member for: 7 years 21 days
    #2 by Mario Jul 17 ’13 at 05:14

    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
    Member
    Member for: 7 years 21 days
    #3 by Mario Jul 17 ’13 at 05:36

    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.

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 6 months 4 days
    #4 by Dmitry Jul 18 ’13 at 04:15

    [#3]: Hello Mario,

    Try the following code:

    fd.field('Choice').control()._el().text()
    
  • Geir Mathisen
    Geir Mathisen
    Member
    Member for: 5 years 11 months 17 days
    #5 by Geir Mathisen Jan 20 ’14 at 10:04

    [#1]: What is the syntax to make the field visable again?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 24 days
    #6 by Dmitry Kozlov Jan 21 ’14 at 06:02

    [#5]: Hello,

    Please, try the following code:

    $('.fd_field[fd_name="V3Comments"]').show();
    
Displaying 1 to 6 of 6 messages