...

View Full Version : Test if the fields will be completed submit will visible



saibri
09-18-2011, 11:25 AM
Hello,

months when I want all the fields will be filled

submit will be visible on all but I just do what has not n'arive test

Note b: there is already invisible submit send # I hope the idea is clear Maintenon.

here is my code jQuery:

$(document).ready(function() {
//------------------ validation champ email par blur -------------
$("#email,#objet,#message").blur(function() {

var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if ($("#email").val() !== "E-mail" && $("#email").val() !== "" && $("#email").val().match(filter)
&& $("#objet").val() !== "" && $("#objet").val() !== "Objet"
&& $("#message").val()!== "" && $("#message").val()!== "Votre message") {

$("#objet,#message,#email").css("border-color","#98D100");
$("#envoyer").fadeIn(2000);
alert('les champs valid');
return true;
}
else {

$("#objet,#message,#email").css("border-color","#FF0000");
$("#envoyer").fadeOut(2000);
alert('les champs not valid');
return false;
}
});
//--------------- animation de champ message -----------------
$("#message").focus(function(){
$("#message").animate({
height: "50px"
}, 1000 );
});

});


here is the html code:

<input id="email" type="text" value="E-mail" onFocus="if (this.value=='E-mail') {this.value=''}"/> <div class="cl"></div> <input id="objet" type="text" value="Objet" onFocus="if (this.value=='Objet') {this.value=''}"/> <div class="cl"></div> <textarea id="message" type="text" value="Votre message" onFocus="if(this.value=='Votre message') {this.value=''}">Votre message</textarea> <div class="cl"></div> <input id="envoyer" type="submit" value="Envoyer"/>

Regards.

sampson1952
09-18-2011, 01:32 PM
your text does not make sense to me. I think if you took the time to review what you typed before submitting your message, you could correct the many typos in your message.

For example: "I just do what has not n'arive test"... what in the world does that mean??



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum