Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Serivce Portal Widget add text field

tommyjensen
Giga Expert

I am adding fields to the Shopping cart in the Angular template large_shopping_cart.html

I added a texarea field and this works fine.

<textarea class="form-control" ng-model="c.requesterPhone" ></textarea>

However a textarea is too big a field for my purpose but I cannot figure out how to change it to a simple one line string field. I tried with "<text></text>" but that becomes readonly.

1 ACCEPTED SOLUTION

Inactive_Us1474
Giga Guru

Try below :


<div>${Enter Description :} <input type="text" size="30" placeholder="Enter description" class="form-control" ng-model="c.requesterPhone"/></div>


View solution in original post

7 REPLIES 7

felladin
Tera Guru

Hello,



Have you tried the rows='1' ?


Standard for textarea is 2, but should be possible to limit to one.


<textarea class="form-control" ng-model="c.requesterPhone" rows="1"></textarea>



You can also find other useful additions here:


AngularJS



With regards


Anton Lindblad


It shrinks the field alright but the user can still expand it and type multiple lines. I do not want that.


Will it work with md-no-autogrow?


<textarea md-no-autogrow rows="1">


Probably. But I used Akhil's suggestion



<div>${Enter Description :} <input type="text" size="30" placeholder="Enter description" class="form-control" ng-model="c.requesterPhone"/></div>