Skip to main content
Share Your Experience: Take the 2024 Developer Survey
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

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
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
1 vote

Form validation in Joomla with form rules doesn't work

The filename must be lowercase and match the name of the rule (not including casing). So rename Custom.php to customnumber.php. Setting the message through $element->attributes()->message doesn'...
Sharky's user avatar
  • 11.4k
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
  • 11.4k
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
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,801

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