Using the sc_field_display macro

Using the sc_field_display macro

To dynamically hide a field in this example, the macro sc_field_display is used, which is responsible for hiding or dynamically displaying a field or several.

This macro has scope in the following events:


In this example, it will be used within an AJAX event of type onChange:

1. The onChange type event is created:


2. Now the macro sc_field_display will be used by means of a condition that is going to hide or show a field dynamically:


3. We save the changes and execute the application


4. When executing all the fields are shown, and also the field "state" which must be hidden by means of the change that is applied to the field "familia_id"


5. Then changing the field "email" and the "customersid" is even, it hides the field "status"


    • Related Articles

    • Macro sc_block_display

      In this example, we will see how to use the sc_block_display macro in an Ajax event using a Radio button on a Form, this macro is intended to hide or show a block. The steps in this example: Configuring Radio type field Configuring and creating ...
    • Using the sc_confirm macro

      In this article, see a practical example of using the sc_confirm macro. This macro can only be used on PHP buttons created in the toolbar of form and control applications, with the aim of confirming the action's excursion. See how to create a PHP ...
    • Macro sc_date

        Scriptcase provides a very useful macro for manipulating dates, which is a very laborious process, however with the use of the sc_date macro (Increments and Decrement Dates), it is much simpler, example:   sc_date (Date, format, operator, D, M, A) ...
    • Using sc_ajax_refresh()

      -Create a grid -At the Ajax Event -New Ajax Event: -Select the Event onClick and the desired field, and create: -Add the following macro: sc_ajax_refresh (); -When clicking on the record in that field, the page would be reloading Corresponding ...
    • Using ajax: onChange events

      In this article we will see how the onChange event works, available in Scriptcase. It is triggered when the object, which makes use of it, has its value changed. Down below is an example of using this event. We will use an order items form, we will ...