Hi
Please can someone cast an eye over my code below and tell me why its not working.
What I'm trying to achieve:
If user has uploaded a photo - do nothing.
If user has not uploaded a photo - insert a generic photo based on which radio button has been selected.
Using php plugin on form with OnBeforeProcess:
//Check if animal type is dog
If ({animals___type}=='Dog')
//Check that a photo has not been uploaded
{If (empty({animals___upload_photo})
//Then apply a generic photo
{$formModel->updateFormData('animals___upload_photo','Doggy.jpg', true);}
}
Please can someone cast an eye over my code below and tell me why its not working.
What I'm trying to achieve:
If user has uploaded a photo - do nothing.
If user has not uploaded a photo - insert a generic photo based on which radio button has been selected.
Using php plugin on form with OnBeforeProcess:
//Check if animal type is dog
If ({animals___type}=='Dog')
//Check that a photo has not been uploaded
{If (empty({animals___upload_photo})
//Then apply a generic photo
{$formModel->updateFormData('animals___upload_photo','Doggy.jpg', true);}
}