On a w form Validation, how to redirect to a custom page

Hello. I created a form in Dreamweaver CS5 that uses validating spry successfully. Once the form is submitted, the user is redirected to the home page. But I don't want this redirect.

My question is, how can I have validated page redirect to a custom thank you page I designed? I do not know the code syntax / exact to write to do what I want and, even if I had the code, I don't know exactly where it should be placed. Please help if you can. Here is the source code. (Redirect) BTW, when I use Dreamweaver behaviors to add a URL, it ignores the required validation and allows you simply click the button submit and redirect.) Thank you very much!

<! DOCTYPE HTML >

< html >

< head >

< meta charset = "UTF-8" >

"" < link href = "... / _css/main.css ' rel ="stylesheet"media ="screen, projection">

"" < link href = "... / forms.css/_css" rel = "stylesheet" media = "screen, projection" >

< title > < / title >

<!-[if lt IE 9] >

" < script src =" http://ie7-js.googlecode.com/svn/version/2.1 (beta4) / IE9.js "> < / script > <! [endif]-->

"" < script src = "... / SpryAssets/SpryValidationTextField.js" type = "text/javascript" > < / script >

"" < link href = "... / SpryAssets/SpryValidationTextField.css" rel = "stylesheet" type = "text/css" >

< script type = "text/javascript" >

<!-* I think that the line of code for redirection is here? ... I don't know how to write code to redirect to the page I want to *->

function MM_goToURL() {//v3.0

var i, args is MM_goToURL.arguments; document. MM_returnValue = false;

for (i = 0; i <(args.length-1); I += 2) eval(args[i]+".location='"+args[i+1]+"'");

}

< /script >

< / head >

< body >

< header id = "pageHeader" >

"< a href ="... / index.htm "" > < img src = ""... / _images/logo.gif "width ="170"height ="91"alt ="Logo of HMN"id ="logo"> < /a >"

"" < img src = "... / _images/tagline.png" width = "296" height = "92" alt = "Slogan HMN' id 'slogan' = >

< / header >

< nav id = 'mainNav' >

< ul >

"< li > < a href ="... / index.htm "> home < /a > < /li >"

"< li > < a href ="... / press.htm "> news < /a > < /li >"

"< li > < a href ="... / about.htm "> on < /a > < /li >"

"< li > < a href ="... / contact.htm "> Contact < /a > < /li >"

< /ul >

< / nav >

< br class = 'clear' >

< div class = "headerContact" >

< / div >

< section >

<!-the webformmailer.php file is located on the web at godaddy.com where server issues->

< section id = "Request" >

< id p = "intro" > ask your link to download < span id = "highlight" > </span > media Kit, please provide the following information: < /p >

"< name of the form = 'Request' method ="post"action ="... /... / webformmailer.php "> < id p ="formCaption"> the fields marked with * are required." < /p >

< p > < span id = "sprytextfield1" >

< label for = "FirstName" > name: * < / label >

< input type = "text" name = "FirstName" id = "name" >

< span class = "textfieldRequiredMsg" > (required) </span > < / span > < / p >

< p > < span id = "sprytextfield2" >

< label for 'name' = > name: * < / label >

< input type = "text" name = "name" id = "name" >

< span class = "textfieldRequiredMsg" > (required) </span > < / span > < / p >

< p > < span id = "sprytextfield3" >

< label for 'society' = > company: * < / label >

< input type = "text" name = "company" id = "company" >

< span class = "textfieldRequiredMsg" > (required) </span > < / span > < / p >

< p >

< label for = "address" > address: < / label >

< input type = "text" name = "address" id = "address" >

< /p >

< p >

< label for = "address_2" > address 2: < / label >

< input type = "text" name = "address_2" id = "address_2" >

< /p >

< p >

City of < label for 'city' = >: < / label >

< input type = "text" name = "City" id = 'city' >

< /p >

< p >

State of < label for 'State' = >: < / label >

< input type = "text" name = 'State' id 'State' = >

< /p >

< p >

< label for "zip" = > Zip: < / label >

< input type = "text" name = "zip" id = "zip" >

< /p >

< p > < span id = "sprytextfield4" >

< label for = "email" > Email: * < / label >

< input type = "text" name = "email" id = "email" >

< span class = "textfieldRequiredMsg" > (required) </span > < span class = "textfieldInvalidFormatMsg" > Invalid format. </span > < / span > < / p >

< p >

< input name = "submit" type = "image" id = "submit" onClick = "MM_goToURL ('parent', 'media_kit_download.htm'); return document. MM_returnValue"src ="... / _images/btn_submit.png ">"

< /p >

< p > < / p >

< / make >

< p >

< /p >

< / div >

< / div >

< / section >

< / item >

< script type = "text/javascript" >

var sprytextfield1 = new Spry.Widget.ValidationTextField ("sprytextfield1", "none", {validateOn:["blur"]});})

var sprytextfield2 = new Spry.Widget.ValidationTextField ("sprytextfield2", "none", {validateOn:["blur"]});})

var sprytextfield3 = new Spry.Widget.ValidationTextField ("sprytextfield3", "none", {validateOn:["blur"]});})

var sprytextfield4 = new Spry.Widget.ValidationTextField ("sprytextfield4", "email", {validateOn:["blur"]});})

< /script >

< / body >

< / html >

You can try to change this:

If ($landing_page! = "") {}

Header ("Location: http://". $_SERVER ["HTTP_HOST"].) "" / $landing_page ");"

}

else {}

Header ("Location: http://". $_SERVER ["HTTP_HOST"].) " /");

}

to: (thankyou.html is a custom page, you can configure)

If ($landing_page! = "") {}

Header ("Location: http://". $_SERVER ["HTTP_HOST"].) "" / $landing_page ");"

}

else {}

Header ("Location: http://www.yourDomain.com/thankyou.html");

}

OR try the reverse, if the above does not work. I don't know what the variable $landing_page is referring to:

If ($landing_page! = "") {}

Header ("Location: http://www.yourDomain.com/thankyou.html");

}

else {}

Header ("Location: http://". $_SERVER ["HTTP_HOST"].) " /");

}

Tags: Dreamweaver

Similar Questions

  • How to implement MOAC on custom pages OAF.

    Hi all

    How to implement MOAC on custom pages OAF. Please help it is very urgent.

    Thank you and best regards,
    MS

    Hello

    Please visit http://mukx.blogspot.com/2009/04/moacmulti-org-access-control-in-oa.html

    Kind regards
    Out Sharma

  • How to redirect to the previous page

    Hello

    I call you a personalized page of standard OA page when I click back to my custom page

    I want to go to the previous page

    I used pageContext.forwardImmediately ();

    but the page id is not valid error can someone suggest how to return to the original page

    page custom

    The example of tutorial wont support the situation go back to the previous page

    Concerning

    Krishna

    Hello

    Give the URL of the page and the page on the previous page function in the pageContext.forwardImmediately or pageContext.setForwardURL methods.

    Thank you
    Kumar

  • How to redirect to the error page custom when the authorization page schema fails

    Hello

    I've done a permission scheme using PL/SQL function return Boolean option.

    I made a custom error page.

    I put this program in one of my pages for authorization. If the authorization scheme fails, I would like the user to be redirected to the custom error page. Currently, it displays a blank page with the mentioned in the section "identify error message displayed when plan violated" page text of the authorization.

    Is there a way I can make this redirect to the custom on the failed authorization error page.

    I am currently using Apex 3.2.0

    Thank you
    Pradeep

    You can create an application process when loading and subordinate to run only when you load your pages, where you want to check if the authorization is successful or not. Your authorization process should run only once per session.

    DECLARE
       v_page_id   NUMBER := 1000;                      -- your custom error page
    BEGIN
       IF     NOT apex_util.public_check_authorization ('MY_AUTH')
          -- your authorization scheme
          AND :app_page_id NOT IN (101, 1000)
       THEN
          HTP.init;
          OWA_UTIL.redirect_url ('f?p=&APP_ID.:' || v_page_id || ':&SESSION.');
          HTMLDB_APPLICATION.g_unrecoverable_error := TRUE;
       END IF;
    END;
    

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

  • How to redirect to a different page after logging into APEX 4.1

    Dear all,
    Here is my requirement when the connection of users,.

    When they entered their username and password and press the login button.
    they redirect to different pages depending on the type of user.
    Here's my LOGIN_TABLE has 3 columns, more
    1 user name
    2 password
    3. type.
    The TYPE has 2 values, employee and admin.
    When the type is admin they should be redirected to page 2,
    reaining IE users used must be redirected to page 3.
    How can I do this? Please give some suggestions.

    Thank you.

    Kind regards

    Gurujothi

    Check it out. Guru user lands on Page 1, other land users to Page 2.

    Here's how it was done.

    a. the CustomAuthentication function returns a Boolean, but does not store the username anywhere. So I changed it.
    b. has created a named FUSER element of the Application (you can change the name and code as you wish).
    c. change the CustomAuthentication function to include the following line just before the return statement

    APEX_UTIL.SET_SESSION_STATE('FUSER',upper(p_username));
    

    So now the user name is stored and used in the session state.
    d. added the branch on Page 1, Onload before header that has Page 2 as its target.
    e. does the conditional branch using the lettering element FUSER. The condition is FUSER <> 'GURU', so that other users are directed to the Page 2.

    Kind regards

  • How do redirect you a web page?

    Hello...

    I am trying to redirect a Web page of a .net site location initial .com.  Basically if someone types in the www.namehere.net I want that they be transmitted on the site www.namehere.com.  What is a simple command?

    Prodigy9 wrote:

    Hello...

    I am trying to redirect a Web page of a .net site location initial .com.  Basically if someone types in the www.namehere.net I want that they be transmitted on the site www.namehere.com.  What is a simple command?

    If you have two simple domain names is to change the CNAME record held by your registrar.  For this you must login to their cPanel (or any system they use) and follow the appropriate instructions.  Have you tried your Registry Office Web site if they have the help files for this?  They should have because it is the most common and regular actions required by webmasters around the world.  For example, they could buy a domain name from an agent but decide to host the site themselves on their servers or use a completely different person in a different country.  WikiLeaks is hosted in a host of test bombs in Sweden, just in case the United States decides to bomb their site!

    For example to connect to the Web site where you bought your domain name dot net and then point it on the DNS of your website dot com.

    I hope this helps.

  • DOCTYPE tag above CF form validation javascript

    Hello

    CF 8 looks back the form validation javascript at the top of the page, even before the HTML tag and the tag DOCTYPE validation.  This causes problems with my style sheet.  Do you know any way I can (at least), put my above the javscript DOCTYPE tag that renders the CF?

    Thank you

    David

    <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    Include the tag head, to make ColdFusion to place script tags. Something like that

    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.DTD">
    http://www.w3.org/1999/xhtml">
    test page




  • Redirect to 3 different pages based on the value of the Auto complete field.

    Hi friends,

    I use a "Auto complete field" in a page for research (Apex version 4.0). But I need to get the values of the 3 tables and when you click on the redirection of the value to one of the 3 pages based on the value.

    For example, I have 3 tables. 1 customer 2 Sites 3.Employees. When I enter "c" in the search field, I need to get values of 3 tables in this area "AutoComplete". That is to say, if I have a customer with the name "cusotmer1", "customer2" and the location with the names of "cisc1", "cisc2" and employees with the name "cid1", "cid2"; When I enter "c" in the FQDN of the auto all 6 values must be given in the "AutoComplete" box and clicking on "customer1" / "customer2" need to redirect to the 'customer' page When you click on 'cisc1' / 'cisc2' redirect to 'site' when clicking on "cid1" / "cid2" redirect to the page of the employees. Is there a way to do this. Help, please.


    Kind regards
    NAV

    Net asset value,
    Here is a sample page that uses the code I proposed works fine for me with FF and IE (8.0).

    http://Apex.Oracle.com/pls/Apex/f?p=18:3

    Note: I've added a warning message before being submitted

    This page works by your side?

  • Redirect to the same page after submitting a form

    I use a landing page form Eloqua to drive online capture at all our shows. Right now, I have been creating pages for individual destination and forms for each of them... which isn't an ideal situation. I also started using query parameters, so I have a default form that will capture a unique campaign for each show ID. It is, I can't figure out how to redirect the submission form!

    Example:

    testing.Eloqua.com/tradeshowleadform?source=CAMPAIGNID123

    On form submission, the source meets the fact that he was from CAMPAIGNID123 and puts it in the system. But I can't get back to this exact URL for redirection! I get to go back to ' testing.eloqua.com/tradeshowleadform"...but I need to the query parameter in order to capture the right campaign."

    Anyone has an idea on how to do it? My one idea was to enter the FULL URL in a field called (returnURL), but don't know how to do this since the request parameters are only for everything after the question mark.

    Any help would be greatly appreciated.

    Thank you!

    -Jon

    Try campaignid1.  If this does not work, you can find the HTML for the merger of field by inserting it into an email or landing page and showing the source code.

  • Spry form validation

    Given that Adobe no longer supports the Spry framework, what do you recommend that I use to validate a form of box?  Not really that in JavaScript or jQuery.  I use DW CC.

    If you use HTML5 forms, add the necessary attribute to your required fields.  It is pretty well supported by most modern browsers, but there is a variability of x-browser in how works.

    jQuery validation is a good method of form validation client-side little but it is dependent on browser and like Spry was, easily beaten by disabling JavaScript.

    The best and most reliable to validate forms is with code (PHP) server in your form-to-email processing script-side.

    Nancy O.

  • JavaScript form validation (stop form submit prior to the selection of the option chosen)

    I check that a "month" has been selected in the options field in a form, which works ok (code below)

    < script type = "text/javascript" >

    <!--

    function checkDayUpdate() {}

    var dm = document.forms.dayUpdate.dayMonth.value;

    inform the customer to select a month to view

    If (dm == null | dm == "Select Month")

    {

    Alert ("Please select a month to view");

    Returns false;

    }

    } / / end of function

    ->

    < /script >

    BUT as soon as I click on the 'OK' prompt in the JavaScript "alert box" in to go back and pick a month I get immediately redirected to the page in the field of 'action' forms until I have a chance to select the month.

    < form name = "dayUpdate" method = "post" action = "updateDays.php" onsubmit ="checkDayUpdate ()" > "

    How can I prevent that from happening?

    See you soon

    Operating system

    You don't say how you trigger the function. Assuming you are using the onsubmit as opening event:

    onsubmit = "return checkDayUpdate()".

    Note that you must return the result of the function, not just run it.

  • How to redirect a page in PHP after submission of user?

    Hi all...

    I created a basic contact/comment form and when I click on the button 'Submit' everything works well, and it sends an email.  Perfect.  A problem though...  It performs a redirect to a new page and it echos a line of small 'Thank You!'.  How to return the user to the page of the contact form on the website (or any other page also?  I'll paste the below short/simple PHP code...

    Any direction on this subject would be appreciated.  Thank you!

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; Charset = UTF-8 "/ >"

    < title > < /title > customer survey

    < / head >

    < body > <? PHP # Script 1.0 - contactlist.php

    If ($_SERVER ['REQUEST_METHOD'] == 'POST') {}

    If (! empty($_POST['first']) & &! empty($_POST['last']) & &! empty($_POST['email'])) {}

    $body = "name: {$_POST ['first']} \nLast name: {$_POST ['last']} \nEMail address: {$_POST ['email']} \nContactez phone number: {$_POST ['phone']} \nContactez preference: {$_POST ['contactvia']} \nBest Contact time: {$_POST ['timepref']} \nComments:\n {$_POST ['comment']}";

    $body = wordwrap ($body, 70);

    mail (' [email protected]', 'NEW customer investigation presentation', $body, ' to: {$_POST ['email']} "" ");

    echo "< p > < em > thank you for your inquiry!  We will answer you as soon as POSSIBLE! < /em > < / p > ';

    $_POST = array();

    } else {}

    echo "< style p =" make-weight: bold; color: #C60 "> please fill in the form!" < /p > ';

    }

    }

    ? >

    < / body >

    < / html >

    OK, first of all, get rid of the $_SERVER ['REQUEST_METHOD'].  Now if a form is set to display your address it will be processed.  Spambots like these forms because you're really not checking if your form has been submitted.  Usually, you should only need to check if $_POST ['something'] is presented.  I know that I have not said this before, but I should have.

    Then, move the at the beginning of the document before the

    Now, remove the "else" statement

    Then remove the line "echo Thank you" and the $_POST = array(); line.  $_POST is a superglobal and always a table, so you never have to define it. And if you redirect someone, there is nothing you need to do the echo.

    So now, your code should be down for:

    <>

    If (isset($_POST['submit']) &! empty($_POST['submit')) //Test if clicked on button named submit submit and not empty

    {

    If (! empty($_POST['first']) &! empty($_POST['last']) &! empty($_POST['email'])) {}

    $body = "name: {$_POST ['first']} \nLast name: {$_POST ['last']} \nEMail address: {$_POST ['email']} \nContactez phone number: {$_POST ['phone']} \nContactez preference: {$_POST ['contactvia']} \nBest Contact time: {$_POST ['timepref']} \nComments:\n {$_POST ['comment']}";

    $body = wordwrap ($body, 70);

    mail (' [email protected]', 'NEW customer investigation presentation', $body, ' to: {$_POST ['email']} "" ");

    Header ('Location: url.php "");  Redirect to the new url if form is submitted

    }

    }

    ?>

    Just move this text "Please fill out the form" to the actual page above the form.  If the user has sent the form, they will then get redirected, if not, they see the page.  Make sense?

  • In head form validator script, error

    When I use the window/Behaveiors/to create a form validator, Dreamweaver CS5 puts the script in the page's head and seems to work ok. But when I validate with the W3c page, it says there are errors with the code and Dreamweaver has created what I have no idea what to do to put right, so could someone please help. It is code generated by Dreamweaver, all other pages have passed with flying colors!

    < script type = "text/javascript" >
    function MM_validateForm() {//v4.0
    If {(document.getElementById)
    var i, p, q, n, test, num, min, max, errors = ", args = MM_validateForm.arguments;
    for (i = 0; I <(args.length-2); I += 3) {test = args [i + 2]; val = document.getElementById (args [i]);
    If (val) {n = val.name; if ((val=val.value)! = "") {}}
    If (test.indexOf ('isEmail')! =-1) {p = val.indexOf (' @');}
    If (p < 1 | p ==(val.length-1)) errors +='-' + nm + "must contain an e-mail address. \n » ;
    } Else if (test! = 'R') {num = parseFloat (val);
    If (isNaN (val)) errors +='-' + nm + 'must contain a number. \n » ;
    If (test.indexOf ('inRange')! = - 1) {p = test.indexOf (': ');}
    min = test. Substring(8,p); Max = test. Substring (p + 1);
    If (num < min | max < num) errors +='-' + nm + must contain a number between "+ min +" and "+ max +".. " \n " ;
    }} ElseIf (test.charAt (0) == 'R') errors += '-' + nm + ' is required. \n " ; }
    } If (errors) alert ("the following error occurred: \n'+errors");
    document. MM_returnValue = (error == ");
    } }
    < /script >

    If the script works well in all browsers, you could put it in an external JS file and link to it, then the W3C validator will not find an error.

    If you do not already know, find out how to do it:

    http://www.Hypergurl.com/jsfiles.html

  • PHP form validation and Radio button group

    Hi David,

    I'm trying to set the initial state of a group of radio voice against zero.

    Please look at the file http://ecopethandbags.com/contact.php . The initial state is set to 'No'

    In Dreamweaver, I've set the initial state to 'off '.

    I don't understand the code for radio buttons in my folder (see attachment).

    What I'm trying to do is to have the radio initially disabled but necessary task.

    I have 2 questions:

    (1) - how can I control the initial state of the radio group when I use PHP form validation?

    (2) - how can I set the validation, when one of the radio buttons is not verified by the user, a warning flag like "Please make a selection" appears.

    Thank you very much!

    Just change the following section of code:

    
    

    Remove the! $_POST. Like this:

    
    

    Checked = "checked" will be inserted in the code if the form has been sent, but no radio button has been selected.

  • PHP and Insert Records form validation

    Hello

    I've been scratching my head for 2 days and could not find a solution.

    Here's my problem:

    Go to http://ecopethandbags.com/contactTest.php and click on the "Send comments" button.

    You will see the validation works.

    Go in http://ecopethandbags.com/contactTestInsert.php , this time, I inserted the server behavior "Insert record".

    Click again on the send comments"" button.

    You will see the naughty message as "'firstname' column cannot be null" in a simple white page.

    My question is:

    How can I insert the form PHP records in my database and take advantage of validation of form as well in http://ecopethandbags.com/contactTest.php

    I enclose files.

    Thank you very much for your help!

    boloco wrote:

    My question is:

    How can I insert records in the form of PHP in my database and enjoy beautifully like form validation in http://ecopethandbags.com/contactTest.php

    Use a simple PHP logic to merge the scripts.

    Dreamweaver automatically updates the server behavior code insert a record into the upper part of the script. You have to adapt so that the validation is done first. If the validation is successful, use the server behavior insert record. If not, display the form again.

    if (array_key_exists('send', $_POST)) {
      // validate the form input
    
      if (!$suspect && empty($missing)) {
      // send the mail
    
        if ($mailSent) {
        unset($missing);
        // insert the Insert Record server behavior code here
        }
      }
    }
    

Maybe you are looking for