Form <textarea> corrections needed on version 4.0.0

Phoca Guestbook - creating guestbooks in Joomla! CMS
StavrosZ
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 May 2022, 09:46

Form <textarea> corrections needed on version 4.0.0

Post by StavrosZ » 13 May 2022, 19:34

  • 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"

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 45045
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Form <textarea> corrections needed on version 4.0.0

Post by Jan » 14 May 2022, 22:54

Hi, sorry, I don't exactly understand what do you mean?
If you find Phoca extensions useful, please support the project

StavrosZ
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 May 2022, 09:46

Re: Form <textarea> corrections needed on version 4.0.0

Post by StavrosZ » 14 May 2022, 23:42

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)

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 45045
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Form <textarea> corrections needed on version 4.0.0

Post by Jan » 15 May 2022, 00:17

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
If you find Phoca extensions useful, please support the project

StavrosZ
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 13 May 2022, 09:46

Re: Form <textarea> corrections needed on version 4.0.0

Post by StavrosZ » 15 May 2022, 09:49

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);

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 45045
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Form <textarea> corrections needed on version 4.0.0

Post by Jan » 17 May 2022, 23:27

Hi, thank you for the code. The problem is if the editor which transforms the textarea code will accept this option :idea:

Jan
If you find Phoca extensions useful, please support the project

Post Reply