Announcement

Collapse
No announcement yet.

show fields and hide fields with checkbox

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • show fields and hide fields with checkbox

    hello, I want to show on screen 2 fields when my checkbox is checked, and when the checkbox is unchecked dont show the fields on screen.
    what's the best way to do this, thanks.
    I uploaded a picture for reference.
    Attached Files

  • #2
    Hey Israel, you can use the sc_field_display({My_Field}, on/off) macro of scriptcase

    Create an ajax event for the checkbox as onChange then use the sc_field_display macro to show or hide the files as you want to.
    Hope this is of help.

    Regards

    Comment


    • #3
      hey kafecadm, I used this code
      Code:
      if ({chkmask} == '0')     // Display field
      {
          sc_field_display({patient}, 'on');
      }
      else      // Hide field
      {
          sc_field_display({patient}, 'off');
      }
      "chkmask = name of my checkbox, patient = the name of the field"

      the field only dissapears from mi screen but dont shows again,, any tips to improve this code. thanks a lot.

      Comment


      • #4
        Originally posted by israel lopez View Post
        hey kafecadm, I used this code
        Code:
        if ({chkmask} == '0')     // Display field
        {
            sc_field_display({patient}, 'on');
        }
        else      // Hide field
        {
            sc_field_display({patient}, 'off');
        }
        "chkmask = name of my checkbox, patient = the name of the field"

        the field only dissapears from mi screen but dont shows again,, any tips to improve this code. thanks a lot.
        How has you defined your checkbox? Probably it hasn't defined and unchecked value. By default, and unchecked checkbox hasn't value. Put 0 as default value and try again.
        /Giuseppe

        Professional Scriptcase Services
        Some Customers opinions

        Comment

        Working...
        X