Search code examples
htmltextboxtextarea

How to change Textarea to Textbox in Html


I need to change textarea to textbox, keep every field. This is my html code:

<div class="row module-show-option">
    <div class="col-md-5 col-sm-12 col-xs-12">
       <div class="form-group">
              <label for="select-name">Other car rental preferences</label>
         <div class="box-group">
             <textarea id="transferMess" name="OtherCarRental" value="@modelData["OtherCarRental"].ToString()" class="form-control" placeholder="Any other vehicle rental preferences?" required>@modelData["OtherCarRental"].ToString()</textarea>
          </div>
        </div>
    </div>
</div>

Solution

  • Use <input> with type="text" like this, don't need a closing tag.

    <input type="text" id="transferMess" name="OtherCarRental" value="@modelData["OtherCarRental"].ToString()" class="form-control" placeholder="Any other vehicle rental preferences?" required>