4

I am using angular material design. This is my code for a floating label for input in HTML.

<h5>LOGIN</h5>
<md-input-container class="md-block">
    <label>Mobile Number</label>

    <input readonly required="" name="mobileNumber" ng-model="mobile" minlength="10" maxlength="10" ng-pattern="/^[0-9]{10}$/">


    <div ng-messages="projectForm.mobileNumber.$error" role="alert">
      <div ng-message-exp="['required', 'minlength', 'maxlength', 'pattern']">
            Please enter 10 digit mobile number.
      </div>
    </div>
    <md-button ui-sref="ConfirmAccount" class="md-primary" >Change Number?</md-button>

</md-input-container>

enter image description here

I want change number? to be displayed on right end of input text i.e. 55555555.

Can anyone help me on this?

BrTkCa
  • 4,703
  • 3
  • 24
  • 45
Devesh Agrawal
  • 8,982
  • 16
  • 82
  • 131

2 Answers2

-1
<input readonly required="" name="mobileNumber" ng-model="mobile" minlength="10" maxlength="10" ng-pattern="/^[0-9]{10}$/">
<md-button ui-sref="ConfirmAccount" class="md-primary" >Change Number?</md-button>

As div is a block element, I believe Change Number? is coming in new line. Now, we have moved it above the div. So, it should be fine.

Naga Sandeep
  • 1,421
  • 2
  • 13
  • 26
-3

Try with style="text-align:right":

Example

<input ng-model="vm.invline.price" type="text" readonly style="text-align:right">

real image: enter image description here

nguyên
  • 5,156
  • 5
  • 43
  • 45