Jump to content

For php expert : How can I make "Message's field" in contact form not being essential ?


albundy11

Recommended Posts

Hi !

I'm not a prog expert.
I modified my contact form and I would like that Message's fields is not essential.
I think the code to modify is in contact-form.php below :


if (!($from = Tools::getValue('from')) OR !Validate::isEmail($from))
$errors[] = Tools::displayError('invalid e-mail address');
elseif (!($message = nl2br2(Tools::getValue('message'))))
$errors[] = Tools::displayError('message cannot be blank');
elseif (!Validate::isMessage($message))


I'm not able to process to the modification.
Is there somebody that could help me ?
Regards.
Link to comment
Share on other sites

Hi !

I'm not a prog expert.
I modified my contact form and I would like that Message's fields is not essential.
I think the code to modify is in contact-form.php below :



if (!($from = Tools::getValue('from')) OR !Validate::isEmail($from))
$errors[] = Tools::displayError('invalid e-mail address');
elseif (!($message = nl2br2(Tools::getValue('message'))))
$errors[] = Tools::displayError('message cannot be blank');
elseif (!Validate::isMessage($message))


I'm not able to process to the modification.
Is there somebody that could help me ?
Regards.


Try removing the text i put in bold. The last line might have more code to it. It would be easier to check it out if you could give me the line where the code is in the original file.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...