Hide a field
Hello,
I have a question about JS :
I try to hide a field when a selection in the other field is made but it doesnt work :
This is my actual code
var Part = fd.field('Typedaffaire').value();
if (Part == 'SEP') {
$('.Partenaires').show();
} else {
$('.Partenaires').hide();
}
Something is wrong ?
Best regards,
I have a question about JS :
I try to hide a field when a selection in the other field is made but it doesnt work :
This is my actual code
var Part = fd.field('Typedaffaire').value();
if (Part == 'SEP') {
$('.Partenaires').show();
} else {
$('.Partenaires').hide();
}
Something is wrong ?
Best regards,
You need to wrap that in an onchange event handler, like this:
Code: Select all
fd.field('Typedaffaire').change(function(){
var Part = fd.field('Typedaffaire').value();
if (Part == 'SEP') {
$('.Partenaires').show();
} else {
$('.Partenaires').hide();
}
});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests