www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Multistage form resets to start

  1. #1
    Join Date
    Sep 2013
    Posts
    6

    resolved [RESOLVED] 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...")
    }
    
    phone = _("Ctelephone").value;
    mobile = _("Cmobile").value;
    email = _("Cemail").value;
    if (valid1 && valid2) { // This is a test to make sure its not the valid1 and valid2 doing it. Partly true
    _("phase3").style.display = "none";
    _("phase4").style.display = "block";
    _("progressBar").value = 99;
    _("status").innerHTML = "Step 4";
    } else {
    
    }
    }

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,360
    You need to supply your HTML and JavaScript and any error messages from the JavaScript console
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
HTML5 Development Center



Recent Articles