function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Long Nguyen 19Long Nguyen 19 

My Input TextField is readonly

I am writing a search popup that when click on the search icon , a popup dialog is opened. From there, i can search account with input text then pass value(account name, account id) back to the main window which is a textInputField
The problem is that, the textInputField in main window is not editable. Please suggest the way to fix. You can see the code below:
<apex:pageBlockSectionItem id="tpbsi">
                    <apex:outputLabel value="Account"/>
                    <apex:outputPanel id="oppnl">
                    	<apex:inputHidden value="{!accountId}" id="targetId"/>
                        <apex:inputText size="40" value="{!accountName}" id="targetName"
                                        onfocus="this.blur()" disabled="false" html-readonly="false"/>
                        <a href="#" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}')">
                            <apex:image id="search" url="/s.gif" styleClass="lookupIcon" onmouseover="this.className='lookupIconOn';" onmouseout="this.className='lookupIcon';" />
                        </a>
                    </apex:outputPanel>
</apex:pageBlockSectionItem>
User-added image
 
Best Answer chosen by Long Nguyen 19
Nitin PaliwalNitin Paliwal
HI,
Use this code

<apex:pageBlockSectionItem id="tpbsi">
                    <apex:outputLabel value="Account"/>
                    <apex:outputPanel id="oppnl">
                     <apex:inputHidden value="{!accountId}" id="targetId"/>
                        <apex:inputText size="40" value="{!accountName}" id="targetName"
                                         disabled="false" />
                        <a href="#" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}')">
                            <apex:image id="search" url="/s.gif" styleClass="lookupIcon" onmouseover="this.className='lookupIconOn';" onmouseout="this.className='lookupIcon';" />
                        </a>
                    </apex:outputPanel>
</apex:pageBlockSectionItem>

Thanks
Nitin

All Answers

Nitin PaliwalNitin Paliwal
HI,
Use this code

<apex:pageBlockSectionItem id="tpbsi">
                    <apex:outputLabel value="Account"/>
                    <apex:outputPanel id="oppnl">
                     <apex:inputHidden value="{!accountId}" id="targetId"/>
                        <apex:inputText size="40" value="{!accountName}" id="targetName"
                                         disabled="false" />
                        <a href="#" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}')">
                            <apex:image id="search" url="/s.gif" styleClass="lookupIcon" onmouseover="this.className='lookupIconOn';" onmouseout="this.className='lookupIcon';" />
                        </a>
                    </apex:outputPanel>
</apex:pageBlockSectionItem>

Thanks
Nitin
This was selected as the best answer
Ashish_Sharma_DEVSFDCAshish_Sharma_DEVSFDC
Hi

Try using below code.
<apex:inputText value="{!accountName}" id="targetName1" required="false" onFocus="this.blur()" disabled="false" />
<a href="#" onclick="openLookupPopupforbEnd('{!$Component.targetName1}','{!$Component.lookup1}'); return false"> <img src="/s.gif"  class="lookupIcon" onblur="this.className='lookupIcon';"onfocus="this.className='lookupIconOn';" onmouseout="this.className='lookupIcon';" onmouseover="this.className='lookupIconOn';"/></a>

Let us know if it helps you.