Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

formGroup and Server-side Validation 18 Jul 2013 23:44 #10521

Hi Admin,
How can I manage the server-side validation on a field like this?:
		<field name="tax"
				label="MY_COMPONENT_FIELD_TAX"
				alias="tax"
				filter="FLOAT"
				required="true"
				class="validate[custom[decimal5to2]]"
				validate="decimal5to2"
				formGroup="extra_options"
				formControl="jform"
				type="cktext"/>

firstly the formGroup and formControl seem to do not be passed to Jdom, I solved that.....but the problem is on the server side validation of the simple "required".
the field is recognized by joomla as jform[tax] and not as jform[extra_options][tax], so submitting the form will always give the error of missing field.
Any suggestion/workaround is welcome.
thanks.


I solved it writing the xml form in the correct way, joomla will manage it correctly. my mistake was to use the fields (successively stored as JSON object), without using the <fields></fields> tag. using the <fields/> tag joomla/jdom will manage it correctly, and the input name will be in this case: jform[extra_options][tax]
and everything will work fine also for the server-side validation.
<fields name="extra_options">	
	<fieldset name="itemview.extraoptions"
			addfieldpath="/administrator/components/com_mycomponent/models/fields"
			label="MY_COMPONENT_JFORM_EXTRA_OPTIONS">

		<field name="tax"
				label="MY_COMPONENT_FIELD_TAX"
				alias="tax"
				filter="FLOAT"
				required="true"
				class="validate[custom[decimal5to2]]"
				validate="decimal5to2"
				type="cktext"/>
	</fieldset>
</fields>

Please Log in or Create an account to join the conversation.

Last edit: by Tomaselli.
  • Page:
  • 1
Time to create page: 0.063 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started