html5 - Restricting characters in bootstrap input field using pattern attribute -


i have following field in bootstrap framework php page.

<div class="col-xs-12 col-sm-10">     <div class="form-group">   <input type="text" name="inp_field1" id="inp_field1" class="form-control input-sm" placeholder="do here..." value='<?php echo($data_text_1)?>' required                                  data-toggle="tooltip" title="do here..." tabindex="3">     </div> </div> 

i need restrict few characters example /@. how can restrict specific characters. not looking can allowed cannot instead. ideally if can done using pattern attribute, great.

try

<div class="col-xs-12 col-sm-10">     <div class="form-group">      <input type="text" name="inp_field1" id="inp_field1"               class="form-control input-sm"               placeholder="do here..." value='<?php echo($data_text_1)?>'               required data-toggle="tooltip" title="do here..."                 tabindex="3"              pattern="[^@\\]"> </div> 


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -