+ Reply to Thread
Results 1 to 4 of 4




  

Thread: Email submit form - success message no redirect

      
  1. #1
    I'm New! seethesun is on a distinguished road
    Join Date
    February 26, 2009
    Posts
    2
    Rep Power
    0
    Feedback Score
    0

    Default Email submit form - success message no redirect

    I am pretty sure I have seen this before, but don't know how to do it.

    I want to have a form (email and name). When the person hits submit it just brings up a success message (they don't leave the page), maybe under the submit button or just in place of the form entirely. I don't want them leaving the page. Not even refreshed.


    The other option I would want is for it to send them to the "success" page and be redirected back to the page they were initially at. But the form will be on multiple pages...is it possible to change the redirect dynamically based on the original page?

    Thanks.

  2. #2
    Jedi Master articweb is on a distinguished road
    Join Date
    April 19, 2008
    Location
    Gloucestershire - UK
    Posts
    101
    Rep Power
    5
    Feedback Score
    0

    Default Re: Email submit form - success message no redirect

    AJAX could do this. Or javascript "DIV".


    Here is an example of a Javascript DIV solution:

    Put this code within the <head></head> tags.
    Code:
    //in the head section
    <script type="text/javascript">
    function showit(){
    document.getElementById('success').style.visibility = 'visible';
    }
    </script>

    Put this code where you want the success message to appear (and change success message as appropriate.
    Code:
    <div id="success" style="visibility: visible">SUCCESS MESSAGE HERE</div>

    Then place this code within the "submit" tag:
    Code:
    onsubmit="showit"
    
    //OR
    
    onclick="showit"

    Hope this helps,
    Josh.
    Website Stats | Website Hosting | SEO Blog

    Got Computer Problems? Need help or remote support?

  3. #3
    I'm New! seethesun is on a distinguished road
    Join Date
    February 26, 2009
    Posts
    2
    Rep Power
    0
    Feedback Score
    0

    Default Re: Email submit form - success message no redirect

    Thanks Josh. That was simple enough.

    I do have another question that you might be able to help me with. I have been searching, but haven't found an answer.

    I am going to have a form (actually a poll) on my site. I am trying to figure out how to send someone to the "thank you" page and based on their answer, redirect them from the "thank you" page to a different page. And have the link (click here if are you aren't redirected in 5 seconds) to change as well

    For instance....

    Do you prefer

    A
    B
    C

    Regardless of answer they are sent to "thankyou.html", then thankyou.html forwards them to www.A.com, www.B.com, or www.C.com depending on whichever they chose in the form.

    Is that possible?

    I think I figured out how to do it without the thank you page so that when they click submit they are automatically sent to the page based on their answer, but would prefer to keep the thank you page in the mix.

    This is that code:

    Code:
    <form action = "<%= "SCRIPT"%>" method="post"> 
    <input type = "radio" name = "page" value = "home" checked>home<br> 
    <input type = "radio" name = "page" value = "tutorials">tutorials<br> 
    <input type = "radio" name = "page" value = "downloads">downloads<br> 
    <input type = "submit" value = "go"> 
    </form> 
    <% 
    'get the users selection from the form 
    strURL = Request.Form("page") 
    'depending on the users selection redirect to that page 
    Select Case lcase(strURL) 
    Case "home" 
    Response.Redirect "index.php" 
    Case "tutorials" 
    Response.Redirect "tutorials.php" 
    Case "downloads" 
    Response.Redirect "downloads.php" 
    End Select 
    %>
    Thanks for any help.
    Last edited by KentuckySlone; Feb 27th, 2009 at 11:38 am.

  4. #4
    I'm New! AdnanAhsan is on a distinguished road
    Join Date
    April 17, 2009
    Posts
    12
    Rep Power
    4
    Feedback Score
    0

    Default Re: Email submit form - success message no redirect

    i doubt bro you have answered yourself, or you did not clearly wrote what you want to do .. is it not redirecting? also try to use full page path .. not only script name "tutorials.php" . use http://www.site.com/tutorials.php it will be helpful if page is on other website not on yours.

    Another thing, above code is asp code. and your are redirecting to php files then i guess files are on other website right?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Fear of Success
    By work2bfree in forum Work at Home
    Replies: 15
    Last Post: Jun 9th, 2010, 6:54 am
  2. Success on Digg.com !!!
    By Armina5 in forum Social Networks
    Replies: 20
    Last Post: Dec 7th, 2008, 10:05 pm
  3. Success with nvb ?
    By eddy in forum Affiliate Marketing
    Replies: 2
    Last Post: Aug 29th, 2008, 1:46 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
WebTalkForums
WebTalkForums
Recent Forum Threads