Hello,
I need to have a lookup field readonly after data input in a subform using Javascript.
Could someone please help me on this?
Thank You.
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Readonly Lookup field
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Readonly Lookup field
Rui, in the form you can add a function like this in Custom Code > Javascript:
and, on each lookup field you want to lock, in Lookup tab > Javascript insert this:
This will lock the lookup code field and remove the magnifying glass; if you need to edit the field, you have to save and reload the record again.
Hope this helps,
Max
Code: Select all
function lockField(id) {
if($("#code"+id).val()) {
$("#code"+id).attr("disabled","disabled");
$("#luup_"+id).remove();
}
}
Code: Select all
lockField("your_field_name");
Hope this helps,
Max
-
- Posts: 177
- Joined: Tue Nov 15, 2011 2:24 pm
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact: