Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Having first control in the page with tabs to be focused
Message
De
30/11/2017 05:20:38
 
 
Information générale
Forum:
AngularJS
Catégorie:
Problèmes
Divers
Thread ID:
01655956
Message ID:
01655968
Vues:
42
>Hi everybody,
>
>I have an HTML page with tabs and this is one of the tabs markup:
>
>
> <div class="form-group" ng-repeat="n in [1,2,3,4]" ng-form="formInfoLabel">
>        <label class="label field-validation-error control-label-error animate-show"
>               ng-show="formInfoLabel.infoLabel.$error.maxlength && formInfoLabel.infoLabel.$dirty">
>            @string.Format(Messages.cannotExceed, string.Format(Labels.paymentInformationLabelX, "{{n}}"), "100")
>        </label>
>        <div class="col-xs-4">
>            <label class="control-label"
>                   ng-hide="formInfoLabel.infoLabel.$error.maxlength && formInfoLabel.infoLabel.$dirty">
>                @string.Format(Labels.paymentInformationLabelX, "{{n}}"):
>            </label>
>        </div>
>        <div class="col-xs-5">
>            <input type="text"
>                   name="infoLabel"
>                   id="infoLabel"
>                   ng-model="currentPaymentType['infoLbl' + n]"
>                   class="form-control"
>                   ng-maxlength="100"
>                   focus="{{n==1}}"
>                   placeholder="@string.Format(Labels.paymentInformationLabelX, "{{n}}")" />
>        </div>
>        <div class="col-xs-3">
>        <div class="checkbox">
>            <label>
>                <input type="checkbox" ng-model="currentPaymentType['infoReqd' + n]"/>
>                @Labels.required
>            </label>
>        </div>
>       </div>
>    </div>
>
>My problem is that the first control doesn't come focused (I tried using directive and just focus). What can I do to make the first control to be automatically focused when I select that tab?
>
>Thanks in advance.

Do you mean you tried the ng-focus directive in angularjs ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform