0

I have used for search a string and when I zoom in or zoom out the screen text box move horizontally on the page also if I Zoom-in the screen text box overlaps the text , is there any way I can keep it just next to label. Can anyone please help me to

VF page:

<apex:pageBlockSection >

              <div class="slds-form-element">              

               <div class="slds-form-element__control">

                  <apex:inputtext styleClass="txtbox" label="Enter value:" value="{!searchstr}" onkeypress="return noenter(event);" style="right:123%; position:relative;"/>

                </div>

               </div><br/>

        </apex:pageBlockSection>

1 Answer 1

0

You need to use a label and field if you try to do it this way.

<div class="slds-form-element">
  <apex:outputLabel styleClass="slds-form-element__label" 
     for="inputField1" value="Enter Value" />
  <div class="slds-form-element__control">
    <apex:inputText id="inputField1" styleClass="slds-input" />
  </div>
</div>

Also, you need to remember to use an appropriate slds-form, such as slds-form_horizontal.

4
  • thanks for your reply. But I wants to show the text box next to label, not on the next line. Is there any way to keep the text box next label and then also keep the width less at constant position so whenever the page opens at different screen the text will always be next to label and won't change the position also.
    – Sharma_raj
    Commented Dec 1, 2018 at 10:50
  • @RAT__ Yes, by specifying slds-form_horizontal.
    – sfdcfox
    Commented Dec 1, 2018 at 10:54
  • I have tried this but still its showing me input text box in next line: <apex:pageBlockSection > <div class="slds-form-element"> <apex:outputLabel styleClass="slds-form-element__label" for="inputField1" value="Enter value:" /> <div class="slds-form_horizontal"> <apex:inputText id="inputField1" styleClass="slds-input" value="{!searchstring}" onkeypress="return noenter(event);" style="width:30%"/> </div> </div> </apex:pageBlockSection>
    – Sharma_raj
    Commented Dec 1, 2018 at 12:26
  • @RAT__ No, the form goes on the outside. Example is in the documentation.
    – sfdcfox
    Commented Dec 1, 2018 at 12:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .