I'm changing user profile plugin in Joomla 3.3, using method described in http://www.inmotionhosting.com/support/edu/joomla-25/user-profile tutorial. Everything works and OK.
But I want to make some changes in profile. In this profile plugin there are two xml files, One for administrator controlling what will appear in registration and profile editing forms, and the second one for the registration (profile editing) form itself.
showon feature works good in the first xml file, but does nothing in second file.
Any ideas about reason and solution ?
@Lodder. I want to add some fields on user profile, based on previous field value. for example if the user is teacher, it brings up course field, if is a student instead brings up classNo. field. So inside plugin profile5 , I changed two files. first one "./plugins/user/profile5/profile5.xml", which is responsible for administration of this plugin. In this file I have added following lines where showon works as expected.
<extension ....>
<name>...</name>
....
...
<config>
<fields name = "params">
<fieldset name = "basic" >
<field> ... </field>
<field> ... </field>
<field> ... </field>
.....
***<field name="register-require_dpost" type="list"
description="If you are a student or teacher, enter it here."
label="Your post student or teacher"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="register-require_dclass" type="list"
description="If you are a student, enter your class here."
label="Your class"
showon="register-require_dpost:1,2"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>***
....
....
The second file I have edited is "./plugins/user/profile5/profiles/profile.xml" here I also added two fields where second one should rise conditionally, but it does not do what expected.
<form>
<fields..>
<fieldset...>
<field.../>
<field.../>
<field.../>
....
***<field
name="dpost"
type="radio"
id="dpost"
description="Enter your post here"
filter="string"
label="Your post"
message="PLG_USER_PROFILE_FIELD_WEB_SITE_MESSAGE"
size="30">
<option value="1">Teacher</option>
<option value="2">Student</option>
</field>
<field
name="dclass"
type="list"
showon="dpost:1"
>
<option value="501">501</option>
<option value="502">502</option>
<option value="503">503</option>
<option value="504">504</option>
<option value="505">505</option>
</field>***
So the problem is about performance of showon in xml file. Is there something in backend which is not present in frontend? Or maybe I'm doing something wrong.
showon
attribute? It is not in the core.showon
does not seem to work in XML files used in front-end. Did you find any solution Hamlet Kraskian ?