User and email should be read only

Phoca Guestbook - creating guestbooks in Joomla! CMS
gtrennert
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 03 Oct 2011, 00:37

User and email should be read only

Post by gtrennert »

Hello

I'm trying Phoca Guest Book and its nice
On my site, the guest book is only for unregistered users
But I don't want that they can modify the username or the email address that are filled in automatically

Did I miss some options ?

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

Re: User and email should be read only

Post by Jan »

Hi, hmmm, in such case you need to customize the output, add e.g. read only attribute to the field inputs.

I am not on my PC now, so I cannot test it but maybe it is enough when you add the read only parameter to the XML where the fields are defined:

components\com_phocaguestbook\models\forms\guestbook.xml

(email, username)

add readonly parameter there:

readonly="true" or
readonly="1"
or readonly

Jan
If you find Phoca extensions useful, please support the project
gtrennert
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 03 Oct 2011, 00:37

Re: User and email should be read only

Post by gtrennert »

Hello

Thanks - I'm not sure to understand :
I modified the xml like this :

Code: Select all

<field name="email" 				type="phocaemail"	class="input-xlarge"	label="COM_PHOCAGUESTBOOK_EMAIL"
	id="guestbook-email" 		validate="phocaguestbookemail"	preicon="glyphicon glyphicon-envelope icon-envelope"
	description="COM_PHOCAGUESTBOOK_FIELD_EMAIL_DESC" readonly="true" />
and I tried the other propositions
But it does not work

Or has there to be done anything other ?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: User and email should be read only

Post by Jan »

Hi, hmm, testing now in latest version - 3.0.4

changing
components\com_phocaguestbook\models\forms\guestbook.xml
to:

Code: Select all

<field name="email" 				type="phocaemail"	class="input-xlarge"	label="COM_PHOCAGUESTBOOK_EMAIL"
			id="guestbook-email" 	readonly="true"	validate="phocaguestbookemail"	preicon="glyphicon glyphicon-envelope icon-envelope"
			description="COM_PHOCAGUESTBOOK_FIELD_EMAIL_DESC"  />
deactivates the form field in frontend, see image
Image

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