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.100 seconds

Les générateurs de code je les connais presque tous pour les avoir essorés en long en large et en travers ... mais celui ci c'est vraiment un outil formidable de simplicité et d'efficacité !
Marc. (liubov - Forum)

Get Started