2

I have used website url input in my registration page for Magento 1. All things are working fine but its validation is not working for all counties.

Ex:

www.example.com (no error)

www.example.in (validation error)

You can see here: http://www.nutraplex.com/index.php/customerActivation/index/wholesale/

I want it should accept all two and three digits.

Thanks

1 Answer 1

3

I found my solution. I went to js/prototype/validation.js

Find: validate-clean-url

Change From

 ['validate-clean-url', 'Please enter a valid URL. For example http://www.example.com or www.example.com', function (v) {
     return Validation.get('IsEmpty').test(v) || /^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(v) || /^(www)((\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(v)
 }],

To

['validate-clean-url', 'Please enter a valid URL. For example http://www.example.com or www.example.com', function (v) {
    return Validation.get('IsEmpty').test(v) || /^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+.([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,3})$)(:(\d+))?\/?/i.test(v) || /^(www)((\.[A-Z0-9][A-Z0-9_-]*)+.([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,3})$)(:(\d+))?\/?/i.test(v)
}],

and it worked.

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.