3
votes
Check if a string is an URL
The best solution would be to use preg_match() with a regular expression. One I've used before is:
((mailto\:|(news|(ht|f)tp(s?))|telnet|webcal|rss|nntp|file\://){1}\S+)
You can also search and find ...
2
votes
Accepted
How to set the form validation only for the fields that are shown
I managed to achieve this via setFieldAttribute. In the XML form I removed the field2 required property and set that dynamically in the form as below.
echo $this->form->renderField('field1');
...
2
votes
Check if a string is an URL
Joomla has no 'url' filter defined, you can check available filters at this url Secure coding guidelines
Also, you can extend JInput class if you want, but I don't think it's worth.
For permanent ...
2
votes
Edit Joomla 3.x library file (to customize form validation error messages)
You can override the JForm class with your own version in one of two ways:
System Plugin
Via a System plugin that triggers onAfterInitialise():
/**
* Registers core library overrides.
*
* @return ...
1
vote
How to validate the Article - Intro Image field in the backend?
To prevent invalid values from being passed to the parent window, you can create an override of mediafield.js (and minified mediafield.min.js) which is located in /media/media/js/ folder.
Add your ...
1
vote
Accepted
Joomla's default server-side validation
If the data you are protecting doesn't contain personally identifiable information I would say that the joomla's stock server-side validation should be plenty for you to use and feel safe. The ...
1
vote
Form-Validation in Frontend
It appears you are submitting the from without executing the validation. Using jQuery, you could listen for the form submit event, check validation and submit the form if it passes.
At the top of ...
1
vote
Check if a string is an URL
Admittedly filter_var($url, FILTER_VALIDATE_URL) is imperfect, but regex is likely to be more so (and as the accuracy of the regex pattern improves, code-bloat will swell and readability/...
1
vote
Ajax in custom handler on client side
I managed to run this validation by small work around. I moved ajax request to input blur method and in form validation hendler I just check some variables which was set after ajax request:
jQuery(...
1
vote
Form Validation - Server Side vs Client Side
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
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
validations × 23joomla-3.x × 9
form × 7
jform × 6
joomla-3.4 × 4
jquery × 3
ajax × 2
validation × 2
php × 1
joomla-2.5 × 1
module × 1
development × 1
javascript × 1
administrator × 1
joomla-3.3.x × 1
security × 1
cms × 1
emails × 1
com-content × 1
fix-my-code × 1
administration × 1
module-params × 1
fields × 1
model × 1
controller × 1