1

I have a page block table :

<apex:pageBlock id="adressInput" mode="maindetail">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="form-group">
                <apex:outputLabel for="street" styleClass="control-label col-md-2">
                    Street
                </apex:outputLabel>
                <div class="col-md-4">
                    <apex:inputText id="street" value="{!searchParameters.street}" styleClass="form-control" html-placeholder="Street..." onkeypress="if (event.keyCode == 13) { searchAddress(); return false; }" />
                </div>
            </div>

By default, the focus is set to the first available inputField. In my case, the first input is a text field(street). Every time I go to the page, the focus is set to that field.

How to remove that autofocus?

0

Give this Code in your VF Page. It will remove the autofocus for all the fields and will put the focus on any field that you want

<script>
    window.onload = function() {
        jQuery('input[type=text]').blur();
        /*
        //For putting the Focus on particular field
        jQuery('[id$=pList]').focus();
        */
    };
</script>

Hope this might helps...

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.