Georgi Antonov
Georgi Antonov

Reputation: 1661

Restrict the user to focus an input

I'm using angular let assume I have the following input

<input class="cell" type="text" ng-readonly="true" ng-model="rowData.bgnInput">

Is it possible to restrict the user to focus this input. So no matter what i do the input should be never focused. I want this because im using this input only to display data and im not using div because if its empty the div gets ugly

Upvotes: 0

Views: 92

Answers (1)

Ovidiu Dolha
Ovidiu Dolha

Reputation: 5413

I think you want readonly, not ng-readonly

<input class="cell" type="text" readonly ng-model="rowData.bgnInput">

Or if you don't want to even be able to select text, use disabled

<input class="cell" type="text" disabled ng-model="rowData.bgnInput">

Upvotes: 1

Related Questions