Validations message based on specifc button click

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Validations message based on specifc button click

spanithi
Hello Team,

I am doing the following
 
I have a form with save, submit, approve and reject buttons.
form also have a comments field (formatted text area) .
Now I am trying to validate this comments field based on Reject button click.If Clicks Reject button without entering any text in the comments field then user has to views a validation warning on the comments field.


Could you please provide some inputs on how to handle this scenario.


Thanks in advance.

Satish

    --
    You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
    To post to this group, send email to [hidden email].
    Reply | Threaded
    Open this post in threaded view
    |

    Re: Validations message based on specifc button click

    Alessandro  Vernet
    Administrator
    Hi Satish,

    So you're saying that when users click on "Reject", then a value for
    "Comment" field must be provided. I imagine that you're storing a field with
    visibility set to `false()` what button was pressed. Let's say that field is
    named `status`, and that you store `rejected` when users click on "Reject".

    Then, in the Control Settings for the Comment field, in the Validations and
    Alerts tab, in Required you could click on Formula, and enter `$status =
    'rejected'`. Would that work for you?

    Alex

    -----
    --
    Follow Orbeon on Twitter: @orbeon
    Follow me on Twitter: @avernet
    --
    Sent from: http://discuss.orbeon.com/

    --
    You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
    To post to this group, send email to [hidden email].
    --
    Follow Orbeon on Twitter: @orbeon
    Follow me on Twitter: @avernet
    Reply | Threaded
    Open this post in threaded view
    |

    Re: Validations message based on specifc button click

    Alessandro  Vernet
    Administrator
    Hi Satish,

    Did you manage to make the "Comment" field required when a specific button
    is pressed, using the suggestion in my previous message?

    Alex

    -----
    --
    Follow Orbeon on Twitter: @orbeon
    Follow me on Twitter: @avernet
    --
    Sent from: http://discuss.orbeon.com/

    --
    You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
    To post to this group, send email to [hidden email].
    --
    Follow Orbeon on Twitter: @orbeon
    Follow me on Twitter: @avernet
    Reply | Threaded
    Open this post in threaded view
    |

    Re: Validations message based on specifc button click

    spanithi
    In reply to this post by spanithi
    Hello Alex,

    I was able to achieve this by adding xpath in readonly under  formulas settings like xxf:user-roles() = 'shf-owner'.
    And in properties I am validating the comments field if it is empty then throwing an alert message.

    Thanks for your inputs

    Satish

    On Friday, December 1, 2017 at 12:03:11 AM UTC+5:30, Satish Panithi wrote:
    Hello Team,

    I am doing the following
     
    I have a form with save, submit, approve and reject buttons.
    form also have a comments field (formatted text area) .
    Now I am trying to validate this comments field based on Reject button click.If Clicks Reject button without entering any text in the comments field then user has to views a validation warning on the comments field.


    Could you please provide some inputs on how to handle this scenario.


    Thanks in advance.

    Satish

      --
      You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
      To post to this group, send email to [hidden email].
      Reply | Threaded
      Open this post in threaded view
      |

      Re: Validations message based on specifc button click

      Alessandro  Vernet
      Administrator
      Excellent Satish, I'm glad you made it work, and thanks for the update.

      Alex

      -----
      --
      Follow Orbeon on Twitter: @orbeon
      Follow me on Twitter: @avernet
      --
      Sent from: http://discuss.orbeon.com/

      --
      You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
      To post to this group, send email to [hidden email].
      --
      Follow Orbeon on Twitter: @orbeon
      Follow me on Twitter: @avernet