I m trying to make a website using form Bootstrap framework. As part of my code I have
<div class="control-group">
<label class="control-label" for="inputTell">Telephone</label>
<div class="controls">
<input type="text" id="inputTell" class="bfh-phone" data-format="(ddd) ddd-dddd">
</div>
</div>
This is the image:
It shouldnt be like that. It shouldn't accept any strings and it should give me the phone format like this:
I already have the necessary JS files in my directory but I am not sure why it is not working.
also, the input type must be "text" or "tel" for formhelpers to work:
snippet part from bootstrap-formhelpers.min.js:
may be useful for someone
you've forgotten to add
<form>
tag.just put your code inside a
<form>
tag, and it will start working.Note: also add necessary classes of bootstrap like controls, form etc.
Make sure the input field is inside a form. The phone helper will not work correctly otherwise.
Example jsfiddle
I've try use type tel and another class