Alert on lookup (none) value
Hi,
I have a lookup column that is not required, so by default SharePoint set the value to (none).
I want to force the user to select a value without to set a required.
For a text field I am using this code in the save onClick event, but this is not working for a lookup column
********************************
if (!fd.field('Body').value())
{
alert('Please, insert the Description.');
return false;
}
fd.sourceFormParam(decodeURIComponent(window.location.href));
return true;
**********************************
Can you help me
Thanks
Catherine
I have a lookup column that is not required, so by default SharePoint set the value to (none).
I want to force the user to select a value without to set a required.
For a text field I am using this code in the save onClick event, but this is not working for a lookup column
********************************
if (!fd.field('Body').value())
{
alert('Please, insert the Description.');
return false;
}
fd.sourceFormParam(decodeURIComponent(window.location.href));
return true;
**********************************
Can you help me
Thanks
Catherine
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Catherine,
You can check Lookup value to be empty like this:
You can check Lookup value to be empty like this:
Code: Select all
if (fd.field('Lookup').value() == 0)
Cheers
Hi!
Yes, check this code please:
Yes, check this code please:
Code: Select all
var html = fd.field('Lookup').control()._el().html();
fd.field('Lookup').control()._el().html(html.replace('(None)', ''));
-
- Information
-
Who is online
Users browsing this forum: No registered users and 19 guests