Page 1 of 1

Form <textarea> corrections needed on version 4.0.0

Posted: 13 May 2022, 19:34
by StavrosZ
  • Form's <textarea> attribute "required" is missing even after setting it in the component's settings:
    Phoca Guestbook --> Control Panel --> Options --> Form (tab) --> Display Content In Form --> Yes (required) --> Save
  • <textarea> inline CSS height is incomplete. It should be "height=250px" instead of "height=250"

Re: Form <textarea> corrections needed on version 4.0.0

Posted: 14 May 2022, 22:54
by Jan
Hi, sorry, I don't exactly understand what do you mean?

Re: Form <textarea> corrections needed on version 4.0.0

Posted: 14 May 2022, 23:42
by StavrosZ
Phoca Guestbook --> Control Panel --> Options --> Form (tab) --> Display Content In Form --> Yes (required)
Even though the content's <textarea> field is set as "required", still a submission is allowed with blank content.

However setting the name and the email fields as "required", no submission is allowed if any of these fields are left blank.
Phoca Guestbook --> Control Panel --> Options --> Form (tab) --> Display Name In Form --> Yes (required)
Phoca Guestbook --> Control Panel --> Options --> Form (tab) --> Display Email In Form --> Yes (required)

Re: Form <textarea> corrections needed on version 4.0.0

Posted: 15 May 2022, 00:17
by Jan
Hi, there is no browser check for the editor form field as this is not possible but it is protected by server side:

Image

Jan

Re: Form <textarea> corrections needed on version 4.0.0

Posted: 15 May 2022, 09:49
by StavrosZ
Actually there is a browser check.
If we place the "required" property in the <textarea> element, the browser will not allow the form to be submitted with blank comments. Instead, the browser will pop up a message pointing to the <textarea> field saying "Please fill out this field.".
The HTML <textarea> element should be like this:

Code: Select all

<textarea  required></textarea>
The option "Phoca Guestbook --> Control Panel --> Options --> Form (tab) --> Display Content In Form --> Yes (required)" should had placed the "required" property in the <textarea> field. But it doesn't.
It's as if we have a duplication of the option "Phoca Guestbook --> Control Panel --> Options --> Form (tab) --> Display Content In Form --> Yes". Both options yield the same result.
The Joomla3 version treats the two options discretely and does add the "required" property in the <textarea>.

Nevertheless I used a jQuery script for my purpose:

Code: Select all

$('#jform_guestbook_content').prop('required', true);

Re: Form <textarea> corrections needed on version 4.0.0

Posted: 17 May 2022, 23:27
by Jan
Hi, thank you for the code. The problem is if the editor which transforms the textarea code will accept this option :idea:

Jan