Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

added 25 characters in body
Source Link
stead
  • 167
  • 1
  • 7

I think the issue is the initial e.preventdefault within your submit event. Please try the code below.

I think the issue is the initial e.preventdefault within your submit event.

I think the issue is the initial e.preventdefault within your submit event. Please try the code below.

Source Link
stead
  • 167
  • 1
  • 7

I think the issue is the initial e.preventdefault within your submit event.

// user fill all fields as it should, so form can be submitted
 conForm.submit(function(e){ 
 var tempval = document.getElementById('fullname').value;
 if(tempval.length ==0){
 //jQuery('#p_username').focus();
 jQuery('#fullname').addClass('bordered2'); 
 jQuery('#fullname').removeClass('good_input'); 
 jQuery("#fullname").attr("placeholder", "Εισάγετε το όνομα σας").placeholder();
 e.preventDefault();
 }
 var sEmail = jQuery('#customeremail').val();
 if (jQuery.trim(sEmail).length == 0) {
 // if user leave the field empty 
 jQuery('#customeremail').removeClass('good_input'); 
 jQuery('#customeremail').addClass('bordered2'); 
 jQuery("#customeremail").attr("placeholder", "Εισάγετε το email σας").placeholder();
 e.preventDefault();
 }
 if (validateEmail(sEmail)) {
 // if the e-mail is valid
 jQuery('#customeremail').removeClass('bordered2'); 
 jQuery('#customeremail').addClass('good_input'); 
 } else {
 // if the e-mail is NOT valid
 jQuery('#customeremail').removeClass('good_input'); 
 jQuery('#customeremail').addClass('bordered2'); 
 sEmail = "";
 jQuery("#customeremail").val(sEmail);
 jQuery("#customeremail").attr("placeholder", "Εισάγετε υπαρκτό email").placeholder();
 e.preventDefault();
 }
 var tempval = document.getElementById('phone').value;
 if(tempval.length ==0){
 //jQuery('#p_username').focus();
 jQuery('#phone').addClass('bordered2'); 
 jQuery('#phone').removeClass('good_input'); 
 jQuery("#phone").attr("placeholder", "Εισάγετε το τηλέφωνο σας").placeholder();
 e.preventDefault();
 }
 //return false; 
 })
lang-js

AltStyle によって変換されたページ (->オリジナル) /