Home › Forums › Quform PHP › Fatal Error message -validation
- This topic has 5 replies, 2 voices, and was last updated 6 years ago by Ally.
- AuthorPosts
- October 24, 2018 at 8:46 pm #27425bb3Participant
Hi Ally,
I got a fatal error messsage, but I know what caused it … I have an input field for a person’s address, but it’s just a single field – a textarea box.
I’m not doing validation right on this field in the process php. If I comment out the validation line on that entry, the form works fine.
I’ve tried a few different options with it, but I’m still not doing it right.Help appreciated
Thanks
Also got this: Does it matter?
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /public_html/quform/lib/PHPMailerAutoload.php on line 45October 24, 2018 at 11:18 pm #27433bb3ParticipantI finally got it working!
In case it ever becomes an issue for anyone else, I’ve included the php which worked for me to validate a textarea. It’s actually given in the process validators file but took me a long time to realise it.$address = new Quform_Element(‘address’, ‘Address’);
$address->addFilters(array(‘trim’));
$address->addValidator(‘required’);
$form->addElement($address);Still somewhat confused though on the naming rules for the above entry. On one part of the documentation, (an example with a fax-number entry) it says all parts to change must match the ‘name’ in the html.
Elsewhere it says the ‘name’ and ‘label’ must be used. Screenshots attached.Attachments:
You must be logged in to view attached files.October 26, 2018 at 4:32 pm #27498AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- This reply was modified 6 years ago by Ally.
October 26, 2018 at 4:37 pm #27499AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 26, 2018 at 11:47 pm #27508bb3ParticipantHi Ally,
Thanks for that detailed explanation. I get the picture now with the naming rules in the php element entry. The bit after the $ symbol was the main source of confusion … the rest ‘name’ and ‘label’ were obvious enough.Your explanation is much better than in the documentation, which I still think is confusing … particularly the fax-number example (attached) which I thought I had sent already – it seems to suggest all the names have to be exactly the same.
Good to have it sorted.
Much appreciatedOn the Deprecated error: The version of PHP, on the hosting I use, is version 7 as far as I recall. Think there is an option to change it … but, everything seems to work ok as is, so, happy enough to leave it alone.
Attachments:
You must be logged in to view attached files.October 30, 2018 at 10:32 am #27535AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.