8 years ago
1
Topic

Hello,

I noticed that, if i try and make ajax validation on a form, on a field that is prepopulated with a live value, e.g. user id, it doesn't work and shows it as available.

Is it a bug?

Thanks

Get a VIP membership
4229 Posts
Kadministrator
8 years ago
0
Level 1

it's a kind of logical thing, ajax validation is only fired when value was changed in the browser while ive value is set on the server side. You will need to add some javascript to fire change event on this field when page loads.

$( document ).ready(function() {

    $('#id_of_your_field').change();

});

Please note that if you put this in the field configuration it might be already wrapped in the $( document ).ready(function() { .. so you will only need $('#id_of_your_field').change(); part.

Get a VIP membership