Validation only on SUBMIT not on Apply

sunnyjey

Active Member
Hello Fabrik Team,

Is there any way where I can restrict Form Field Validation (like not empty) strictly to the SUBMIT (when user hits Submit button) and NOT on APPLY (apply button of the form) through PHP form Plugin ?

In other words, how do I know that Form is submitted through APPLY button OR SUBMIT button ?
 
In PHP form plugin onBeforeProcess:
PHP:
$apply = JRequest::getVar('apply', false);

if($apply != false) {
   //check if some field is empty, if yes then return false
   $some_element = '{table___element}';
   if($some_element == "") {
      $formModel->setFormErrorMsg("Some error message");
      return false;
    }
}

P.S. This exact code is not tested!
 
Last edited:
I'm not at my PC for some time, but you can var_dump the $apply and $element_value and see if these contain what's expected. Maybe you're missing _raw from your element placeholder etc.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top