Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Test if the fields will be completed submit will visible

    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:
    Code:
    $(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:
    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.
    Last edited by saibri; 09-19-2011 at 06:59 PM.

  • #2
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 1 Time in 1 Post
    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??


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •