This has been extremely helpful for both learning the framework and php in general. I was hoping someone could help explain a few things in further detail as I am really new to Processwire and somewhat new to php other the working with WordPress. I have used Soma's code example which is extremely useful and altered it to my needs. I am attempting to create a simple contact form, but was unsure of a few things.
Below, she provides a validation check for any hotmail addresses. Are there any other validations required or suggested if you are planning on having the submissions emailed to you? IE, check if is a valid email address with FILTER_VALIDATE_EMAIL or is this done for you
$email = $form->get("email");
if($email && (strpos($email->value,'@hotmail') !== FALSE)){
// attach an error to the field
// and it will get displayed along the field
$email->error("Sorry we don't accept hotmail addresses for now.");
}
Secondly, any tips on how I would send the values submitted by email to the admin user or any user/email?
$email = $form->get("email")->value;
$name = $form->get("name")->value;
$name = $form->get("text")->value;
Thanks in advance for the community support and I am looking forward to working more with Processwire. The form builder is on my to get list and will same me hours of time, but I thought understanding the inside of it will benefit me more.
Although I would still like to understand the above, I went with a similar solution others may find usefull here