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 ...
George Sexton's user avatar
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'); ...
Malaiselvan's user avatar
  • 2,701
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 ...
José Sánchez Martín's user avatar
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 ...
Drew G's user avatar
  • 890
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 ...
Sharky's user avatar
  • 10.5k
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 ...
onLoad's user avatar
  • 48
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 ...
Brian Bolli's user avatar
  • 1,416
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/...
mickmackusa's user avatar
  • 4,781
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(...
Tomasz Omeljaniuk's user avatar
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
Marko D's user avatar
  • 471

Only top scored, non community-wiki answers of a minimum length are eligible