Hide "create new" link for a cross site lookup field
This would hide the button:
Code: Select all
fd.field('csl').control()._el().find('.plumsail-csl > a').hide();
csl is the internal name of the field. Note, you may also want to change height of the control when you hide the button
fd.field('csl').control()._el().css('height', '24px');
i'm only trying to hide the link if the form was opened as modal via another form, so i used the same line of code that is working for me in the normal view and placed it inside the if statment that checks if window.top != window.self, but the link is still shown, i even tested more with the same line of code place on form load not inside the if statment to check, it doesn't work as well when the form is opened in modal view via another form
Actually no, i want to hide it only if the form is opened in modal view via another form, and this situation could happen via different forms. For example a user might be adding a project or a sales opportunity or whatever form that has a contact field(parent form), and then the user clicked on the add new contact link associated with the contact field on the parent form, so the contacts form(child) will be opened in modal view and taking the value of the parent company, now i don't want the contact form(child) to show add new company below the company field that is already auto-populated via the parent form.
If I understood you correctly: Add the following CSS to the page:
Then you can use the following code to show the button when and as you need to:
Code: Select all
[fd_type="PlumsailLookup"] {
height: 24px;
}
.plumsail-csl > a {
display: none;
}
.plumsail-csl-add-visible [fd_type="PlumsailLookup"] {
height: 41px;
}
.plumsail-csl-add-visible .plumsail-csl > a {
display: inline;
}
Code: Select all
$('body').addClass('plumsail-csl-add-visible');
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests