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.047 seconds
  I still don't believe he can really be human to do all this ! From all of the forums that I've ever participated in this is certainly the one that most encapsulates the feeling of being truly open source where everyone's opinions and contributions can and will shape the development of the service! It's truly awesome! Hope you enjoy cooking and look forward to reading and contributing to any of the editorial work that you proposed too!! Thanks
Gez (audibleid - JED)

Get Started