dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: One Button with Multiple Functions

  1. #1
    Join Date
    Feb 2006
    Posts
    5

    One Button with Multiple Functions

    Good afternoon developers, i been searching the Internet for two days with this problem and gotten some answers but none seem to work.

    I have a text box which the user will input their email address within. I also have a button that when pressed, i would like it to email me the information in the text box and also redirect the user to another page that will simply act as a confirmation page that we recieved the email. I have the text box and when the button it pressed it sends me an email, this is working perfect but i do not know how to make the button redirect to another page with the same click of the button. Help please here is some of the code. Thank you.


    <form action="MAILTO:myemail@mydomain.com" method="post" enctype="text/plain">

    <input type="text" name="mail"
    value="Email Here" size="20" style="font-family: Arial Narrow"> <input type="submit" value="Unsubscribe" style="font-family: Arial Narrow">

  2. #2
    Join Date
    Nov 2003
    Location
    Worthington, OH, USA
    Posts
    3,634
    Change your button to:

    <input type="button" onclick="this.form.submit();document.location.href='confirmPage.htm';" value="Unsubscribe" style="font-family: Arial Narrow">
    54 68 65 42 65 61 72 4D 61 79

  3. #3
    Join Date
    Feb 2006
    Posts
    5

    thank you

    TheBearMay you are the best. I know this was probably super simple to you but I had very difficult time figuring it out and you really hit the nail in the coffin. I really appreciate your help. Thank you.

  4. #4
    Join Date
    Mar 2004
    Location
    Glasgow, Scotland
    Posts
    613
    I'm not sure that would work as the call to submit would leave to go to the form action url before the location call. I'd be interested to hear if this solution did work.

    If it doesn't you may have to have a processing page that deals with the form data and then redirects to the confirmPage.htm

  5. #5
    Join Date
    Nov 2003
    Location
    Worthington, OH, USA
    Posts
    3,634
    I tested it before I posted to make sure, so yes it does work. The reason it does work is that it doesn't pause to wait for the first step to complete.
    Last edited by TheBearMay; 02-28-2006 at 06:59 PM.
    54 68 65 42 65 61 72 4D 61 79

  6. #6
    Join Date
    Feb 2006
    Posts
    5

    Works Great

    The code provided by BearMay works perfect with the code i provided as the example.

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



Recent Articles