ZenphotoCMS Forum
Guest comments not accepting Name/Email fields - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Guest comments not accepting Name/Email fields (/thread-8640.html)



Guest comments not accepting Name/Email fields - amereservant - 2011-05-23

I'm completely stumped on this one...
I cannot get the comment form to accept the [b]name[/b] and [b]email[/b] fields on the theme I created.

It works fine for logged-in users, but when a visitor tries submitting a comment, it says the name and email fields must be specified. I dumped the [b]$stored[/b] array and the $stored['comment'] parameter is the only one storing the value, but the $stored['name'] and $stored['email'] values are always empty.

Any ideas why? I'm using a [b]comment_form.php[/b] template if that makes any difference.

You can try it at http://m5url.me/photos on one of the photos.




Guest comments not accepting Name/Email fields - acrylian - 2011-05-23

Did you try if it works on the standard themes? If so, there might be something wrong in your theme.




Guest comments not accepting Name/Email fields - amereservant - 2011-05-23

Yes, I did try the standard themes and it does work, so therefore it IS a problem with my theme.
However, I copied the form fields from those themes and since the form is submitted to #, I'm not sure at this point how the comment submission is being handled.




Guest comments not accepting Name/Email fields - acrylian - 2011-05-23

Ok, I always need to ask that as many people don't try that. I am not sure what you mean with "copied the form fields from those themes". All you should need to copy is the printCommentForm() function which the comment_form plugin provides.




Guest comments not accepting Name/Email fields - amereservant - 2011-05-23

Ok, I found the problem. My function for printing the disabled form field's hidden input fields wasn't testing correctly, so the hidden fields were being printed with the same [b]name[/b] attribute as the non-disabled fields.

The reason I created my own comment form is because the one printed by ZenPhoto is formatted as a table and that's not tabular data.
Since part of my goal was to use the best HTML/CSS formatting practices, I removed all of the table-formatted syntax that didn't contain tabular data such as the comments and comment forms.




Guest comments not accepting Name/Email fields - acrylian - 2011-05-23

I can understand that concern regarding semantics. We probably really should change that sometime to use labels (there are places on the backend as well).

But there always more important things come in the way since this works although not correct semantically. And of course it will break some older themes as well.