I'm sorry if this question has already been asked, but i didn't find a solution.
I have 3 radios elements and I want to check the value when the selection changes and when the page loads.
I would do that by using only the on() function.
My problem is that only the change event is triggered.
Here is my current code :
$('.user').on('load change', function(){
if($(this).val() == 'client'){
$('#user_parent').removeAttr('disabled').closest('tr').show(200);
}else{
$('#user_parent').attr('disabled', 'disabled').closest('tr').hide(200);
}
});"
I also tried to replace load by ready, but it failed too. What the problem ? Isn't the load event available for a single element ?
The code is placed in $(document).ready(...), and the elements are all displayed when the page is sent.
Thanks