2

I have got the Bootstrap 3 code below:

<div class="form-group">
    <div class="col-sm-3 control-label">
        <label>Surname:</label>
    </div>
<div class="col-sm-9">
    <input class="form-control" type="text" name="surname"><span>!</span>
</div>

And I need to show the exclamation mark next to the input, but it is always on the new line. How to put it nex to the input, please?

Thanks

Lunack
  • 343
  • 1
  • 5
  • 14

2 Answers2

4

Use this code, it works

   <div class="form-group">
        <div class="col-sm-3 control-label">
            <label>Surname:</label>
        </div>
    <div class="col-sm-9">
        <div class="input-group">
        <input class="form-control" type="text" name="surname"><span class="input-group-addon">!</span>
        </div>
    </div>
Jagadesh K
  • 237
  • 1
  • 13
  • Thanks, I have already tried that, but (and I am sorry that I didnt mention it in the question) I cannot use this for checkboxes or textareas. – Lunack Mar 05 '14 at 21:57
2

If your using a form-inline it will work like this..

<form class="form-inline">
  <div class="form-group">
      <label>Surname:</label>
      <input class="form-control" type="text" name="surname"> !
  </div>
</form>

http://www.bootply.com/119169

Carol Skelly
  • 351,302
  • 90
  • 710
  • 624