Results 1 to 3 of 3

Thread: One submit button to go to 2 different pages depending on user input

  1. #1
    Join Date
    May 2006

    Question One submit button to go to 2 different pages depending on user input

    I need to create a form with an Email Adddress Changed and a Password Changed.
    Here is the problem...
    On the submit button, I need it to go to a conformation page if they change their password, or a different confirmation page if the change their Email Address.
    I can't seem to figure out how to code the Javascript on one submit button...
    Help Please

  2. #2
    Join Date
    May 2006
    Portsmouth, Uk
    you can do the check using PHP or javascript,
    for php just check the wich $_POST data is not empty and do the acction regarding this
    contact for more details

  3. #3
    Join Date
    Dec 2004
    The only problem with a JavaScript solution, in this case, is what if JavaScript is disabled?

    <form ...etc... action="" onsubmit="
    if(!/^\s*$/.test(this.newmail.value)) {
    this.action = 'confirm_email.php';
    return true;
    if(!/^\s*$/.test(this.newpass.value)) {
    this.action = 'confirm_password.php';
    return true;
    alert('No change made.');
    return false;">

Thread Information

Users Browsing this Thread

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

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