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

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started