Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="form-group form-inline phone">
- <label class="col-sm-2 control-label">Phone</label>
- <div class="col-sm-10">
- <input type="text" class="form-control" id="phonetype1" placeholder="Type of Phone">
- <input type="text" class="form-control" id="number1" placeholder="Write here your phone number">
- </div>
- </div>
- <span id="newPhone"> Add a phone number</span>
- $("#newPhone").on('click',function(){
- var numItems = $('.phone').length +1;
- var newPhone= '<div class="form-group form-inline phone">';
- newPhone+= '<label class="col-sm-2 control-label"></label>';
- newPhone+= '<div class="col-sm-10">';
- newPhone+= '<input type="text" class="form-control" id="phonetype'+numItems+'" placeholder="Type of Phone">';
- newPhone+= '<input type="text" class="form-control" id="number'+numItems+'"" placeholder="Write here your phone number">';
- newPhone+= '</div> </div>';
- $(this).before(newPhone);
- });
- $(function()
- {
- $("input").on('blur',function(){
- var formElementId = $(this).attr("id");
- validateField(formElementId); //This function works, for sure
- });
- });
- $("form").on('blur','input',function(){
- var formElementId = $(this).attr("id");
- validateField(formElementId); //This function works, for sure
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement