You need to sign in to do that
Don't have an account?
SF7
Hide InputText Field in Vf page
hi,
i had a visual force page with dependencies on it and in my vf page i had a input filed which should not appear and i cant delete that field as it is controlling the dependecies can i just hide that field and how can i do it.
this is my field code
<apex:inputField id="LOB" value="{!wrapper.ocr.Line_of_Business__c}" style="width:300px"/>
thanks
akhil
add rendered='FALSE' to the tag
hi thanks for replying
and tried rendered tag it's even disabling the functionality
akhil
Hi,
If you want to hide input field there are 2 ways to achieve this:-
<div style="display:none;">
<apex:inputField id="LOB" value="{!wrapper.ocr.Line_of_Business__c}" style="width:300px"/>
</div>
2. Or use <apex:inputHidden/> instead of <apex:inputField/> and assign value in inputhidden field using javascript.
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Hey,
Thanks For Replying,
I tried the div tag and i still see the filed on the page
and i tried even using the apex:inputhidden tag but what happens is the field disappears and the dependecies are also gone
thanks
Akhil
Try in following way :-
<apex:inputField id="F1" value="{!<Your variable name>}" />
<script>document.getElementById('{!$Component.F1}').style.display = 'none';</script>
I think it should work as I have tried it .
I tried this and it worked with javascript, however the lavel and the lookup icon remain (only the field itself becomes hidden)
Any ideas how to get rid of the label/lookup icon?
Hi,
You have to hide them too using javascript like :-
for lookup icon :-
document.getElementById('{!$Component.F1}_lkwgt').style.display = 'none';
for label :-
document.getElementById('<id of label>').style.display = 'none';
you can inspect the dom id in firebug or any other means.