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
    Oct 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multistage form resets to start

    I'm working on a multistage form . The problem is that it wont get past the 3rd stage . If you click continue it resets back to the start.

    Here is a like to the page on my server -http://www.mk18.co.uk/test

    I have a feeling its probably to do with the java script , but at one point it did work.

    You can view the full page code by viewing the source.

    EDIT : Variables valid1 and valid2 are defined , the probelm seems to be in the processPhase3() function

    EDIT 2 : I changed the if (valid1 && valid2) in processPhase3 to if(email.length > 1){ to make sure it wasnt the valid1 / 2 causing the problem. It now lets me through , but then takes me to step one after step 4 has loaded.

    Function :

    Code:
    function processPhase3() {
    var tele = document.getElementById("Ctelephone");
    var pattern2 = tele.getAttribute("pattern2");
    var re1 = new RegExp(pattern2);     
    var valid1 = re1.test(tele.value);
    if (valid1) {
    //alert("matches phone!")
    } else {
    //alert("pattern doesn't match...")
    }
    
    var mail = document.getElementById("Cemail");
    var pattern3 = mail.getAttribute("pattern3");
    var re2 = new RegExp(pattern3);     
    var valid2 = re2.test(mail.value);
    if (valid2) {
    //alert("matches email!")
    } else {
    //alert("pattern doesn't match...")
    }
    
    //var validmail = ( /[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/.test(email) ); JUST A TEST
    //phone.length = 11 && validmail
    
    phone = _("Ctelephone").value;
    mobile = _("Cmobile").value;
    email = _("Cemail").value;
    if (valid1 && valid2) { 
    _("phase3").style.display = "none";
    _("phase4").style.display = "block";
    _("progressBar").value = 99;
    _("status").innerHTML = "Step 4";
    } else {
    
    }
    }

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,536
    Thanks
    80
    Thanked 4,490 Times in 4,454 Posts
    Worked fine for me. Got all the way to step 4 with no problems. Then got to "Data Overview" once I actually filled in the Enquiry field (which you say nothing about when no value is given!).
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Tags for this Thread

    Posting Permissions

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