5

I have a simple form with phone inputs and some email inputs, however I cannot get rid of the default browser warning messages that come up when I click the submit button.

enter image description here

My CodePen

I've tried to implement event.preventDefault(); however it doesn't seem to work in my case.

$('#profile-info-form').unbind('submit').bind("submit", function(event) {
    event.preventDefault();
    console.log('save button clicked');
});

Example of the input fields I create on the fly:

var myphone = "<li><label>Cell Phone:</label></li><li><input type='tel' pattern='[0-9]{10}' class='added_mobilephone' name='mobilephone' value='' autocomplete='off' maxlength='20' /></li>";


How would you handle this problem?

Community
  • 1
  • 1
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
  • Added my comment as an answer. – prodigitalson Aug 01 '13 at 14:56