1

Just got confused by seeing both type of validations in Joomla. So far my understanding of these 2 is as below

Client Side Validation

Done via jQuery/Javascript on the client browser

Server Side Validation

Done at server after the page got submitted

Trying to understand how server side validation works with a simple mandatory field example.

The XML form field as below

<field name="note_name" 
  type="text" 
  label="Note Name" 
  required="true" />

In the default.php I have the below code

//JHtml::_('behavior.formvalidation');
<form .... class="form-vertical" ...>
echo $this->form->renderField('note_name');
<button type="submit" class="btn btn-primary">Save</button>

In the above code I have not included any client-side validation code and I was thinking the page will get submit and the server will do the validation. But the page doesn't get submit and it simply shows a nice popup near to the field asking to 'Please input this field'.

What am I missing here? Why the client validation is getting triggered even though I haven't included any client side validation code?

1

It is automatic validation by your browser because required attributed is set on the input field. Here is a list of browsers that support this: http://caniuse.com/#feat=form-validation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.