php - Place error message inside a bootstrap input -


i have php validates if input empty if error message displayed e.g email required, using bootsrap form. message displayed under input (which dont want).

code im using:

<label>number of rooms: </label>                                             <input type="number" class="form-control input-sm" max="10" name="rooms" value="<?php echo $roomerr;?>"> <span class="error">* <br><?php echo $roomerr;?></span> 

here link website website

i want display error message inside text input tried assigning error value of input:

<label>number of rooms: </label>                                             <input type="number" class="form-control input-sm error" max="10" name="rooms" value="<?php echo $roomerr;?>"> 

the following not work.

my css assignes error color red

.error{ color:red; } 

i cant find stuff this.

thanks

you can try this, because working placeholder.

 <input type="number" class="form-control input-sm error" max="10" name="rooms" placeholder="<?php echo $roomerr;?>"> 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -