Validate a form element depending on another form element

Home Forums Quform PHP Validate a form element depending on another form element

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13172
    hutdji
    Participant

    Hi,

    I want to validate a form element depending on another form element: if form element “kundennummer” is empty the user must fill the name field.

    With the following code in process.php it is not working:

    if ($form->getElement(‘kundennummer’)->isEmpty()) {
    $name->addValidator(‘required’);
    }

    Any idea?

    Thanks and regards,

    Henning

    #13186
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #13187
    hutdji
    Participant

    Hi Ally,

    thanks for the quick reply – and the solution!

    Regards,

    Henning

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy