Announcement

Collapse
No announcement yet.

Change from Required to Not Required and visa-versa

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

  • Change from Required to Not Required and visa-versa

    How would you programatically change a field from
    Required to Not Required
    and
    Not Required to Required

  • #2
    Originally posted by Larryh1115 View Post
    How would you programatically change a field from
    Required to Not Required
    and
    Not Required to Required
    Manually.

    OnValidate you can see the conditions for a field to be required, and if true, then throw an sc_error
    /Giuseppe

    Professional Scriptcase Services
    Some Customers opinions

    Comment


    • #3
      Giu -
      How would identify that the hidden field is what is throwing the error, as per your comment "OnValidate you can see the conditions for a field to be required, and if true, then throw an sc_error"

      since I am hiding various fields under certain conditions, which are Required when visible, how would I disable the Required on the "hidden fields"

      Comment


      • #4
        I wrote from mobile. What I mean, is, you can do your checks onValidate event, and if there are some "thing" thath must avoid to validate, then throw an error.

        For example. {value} is required when {manualValue} is true, then, you can
        Code:
        if ({manualValue}){
           if (empty({value})) {
                sc_error_message("Value can't be empty");
           }
        }
        I hope I explained better.
        /Giuseppe

        Professional Scriptcase Services
        Some Customers opinions

        Comment


        • #5
          @Gui, this is not exactly what he meens.
          if you set a field as required and it is hidden, the insert/update will not work when it is empty !
          @Larry two possibilities:
          1. When the field is hidden, give the field a value ( 0 ? )
          or
          2. set it as not required, and when it is visible then do Gui's suggestion !

          Comment


          • #6
            Thanks Gerd, wow didn't even think of that.

            Comment

            Working...
            X