Lookup issue
Hello guys,
I have a problem with a lookup column :
i have some JS on it :
fd.field('Type_x0020_d_x0027_affaire').control().change(function()
{
if (fd.field('Type_x0020_d_x0027_affaire').control().value( 'SEP'))
{
$('.fd_field[fd_name="NomDesPartenaires"]').show();
}
else if (fd.field('Type_x0020_d_x0027_affaire').control().value('GROUPEMENT'))
{
$('.fd_field[fd_name="NomDesPartenaires"]').show();
}
else
{
$('.fd_field[fd_name="NomDesPartenaires"]').hide();
}
});
And my problem is on my lookup column, my value didn't appear on my field ''Type_x0020_d_x0027_affaire'' and my field 'NomDesPartenaires' still show when i switch from another value.
Any idea ?
Best regards,
I have a problem with a lookup column :
i have some JS on it :
fd.field('Type_x0020_d_x0027_affaire').control().change(function()
{
if (fd.field('Type_x0020_d_x0027_affaire').control().value( 'SEP'))
{
$('.fd_field[fd_name="NomDesPartenaires"]').show();
}
else if (fd.field('Type_x0020_d_x0027_affaire').control().value('GROUPEMENT'))
{
$('.fd_field[fd_name="NomDesPartenaires"]').show();
}
else
{
$('.fd_field[fd_name="NomDesPartenaires"]').hide();
}
});
And my problem is on my lookup column, my value didn't appear on my field ''Type_x0020_d_x0027_affaire'' and my field 'NomDesPartenaires' still show when i switch from another value.
Any idea ?
Best regards,
Please refer to this page to see how to get and set field values in relation to their types: http://spform.com/forms-designer- ... eld-values
If you want to see if the text of the lookup field entry is 'SEP' you have to do:
Although, best to compare by id's.
If you want to see if the text of the lookup field entry is 'SEP' you have to do:
Code: Select all
if (fd.field('Type_x0020_d_x0027_affaire').control('getSelectedText') === 'SEP') {...}
i have the same issue per / ID or with your cmd :
i have this atm :
//Nom des partenaires SEP
$('.Partenaires').hide();
fd.field('Type_x0020_d_x0027_affaire').control().change(function()
{
if (fd.field('Type_x0020_d_x0027_affaire').value(3))
{
$('.fd_field[fd_name="NomDesPartenaires"]').show();
but no success :
When i pick a value from my lookup :
when my value is selected :
any idea ?
i have this atm :
//Nom des partenaires SEP
$('.Partenaires').hide();
fd.field('Type_x0020_d_x0027_affaire').control().change(function()
{
if (fd.field('Type_x0020_d_x0027_affaire').value(3))
{
$('.fd_field[fd_name="NomDesPartenaires"]').show();
but no success :
When i pick a value from my lookup :
when my value is selected :
any idea ?
As I have stated above
sets the value of the field.
If you want to compare the value you should do:
If the field is a single CSL field, then your code sets the value of the field to ID = 3, display text = nothing.
Code: Select all
fd.field('Type_x0020_d_x0027_affaire').value(3)
If you want to compare the value you should do:
Code: Select all
fd.field('Type_x0020_d_x0027_affaire').value() === 3
-
- Information
-
Who is online
Users browsing this forum: No registered users and 19 guests