You need to sign in to do that
Don't have an account?
yvk431
how to make a lookup field readonly
Hi all,
I have a lookup field inside a repeater on a visual force page . I need to make it a read only field .
Can any oe tell me how i can achieve this using javascrpt
I tried using the script tag
<script>
document.getElementById('page:form:pbs:fieldnm').disabled = true.
</script>
But as since it was inside a repeater the id of the field is generated as 'page:form:pbs:firs:0:fieldnm'
so how to make readonly for all the items in the list .
Also , the lookup field consists of somany ids such as _lkid , _lkold which id we need to conisder. Please help me out
Atlast got it, used a span tag as a container to the lookup inputfield and set its display to none using javascript
All Answers
Why do you need to do this in javascript? Why not just use outputField?
because i need to use another lookup which is having filter with criteria dependant on this field value. If I am making this field as read only with fls or field type other than "inputField" the dependant lookup is not working.
sorry it worked out great , but only after the record is inserted. while inserting, the lookup filter is not displaying the values
Please suggest.
Atlast got it, used a span tag as a container to the lookup inputfield and set its display to none using javascript