Different actions from one form.
-
I am wondering how (if it is possible) to do the following: You have a login form with a login ID (email address) and a password. When the user clicks the "Submit" button, go to a page that varifies the email address and password. That part I've got done -- easy. What I would like is to have another button, or a link, that will go to a different page that will send the user their password in an email. So what I'm wondering is how can this other page (the one sending the email) get the email address the user entered on the form? I would rather not simply redirect them to a second page where they enter the email address. If possible, I would like to be able to read the email address entered on the login form. Can it be done? If so, how? My understanding is that the data on the form is not available to subsequent pages until the form is submitted (which activates the "action" page, right?). Is there a way around that, or am I missing something basic? Thanks.
-
I am wondering how (if it is possible) to do the following: You have a login form with a login ID (email address) and a password. When the user clicks the "Submit" button, go to a page that varifies the email address and password. That part I've got done -- easy. What I would like is to have another button, or a link, that will go to a different page that will send the user their password in an email. So what I'm wondering is how can this other page (the one sending the email) get the email address the user entered on the form? I would rather not simply redirect them to a second page where they enter the email address. If possible, I would like to be able to read the email address entered on the login form. Can it be done? If so, how? My understanding is that the data on the form is not available to subsequent pages until the form is submitted (which activates the "action" page, right?). Is there a way around that, or am I missing something basic? Thanks.
<form action="original.html" method="post">
<input type="text" name="email">
<input type="password" name="passwd">
<input type="submit" value="OK">
<input type="button" value="Forgot Passowrd" onClick="this.form.action='newpage.html';this.form.submit();">
</form>Jeremy Falcon Imputek "..." - Paul Watson 07-17
-
<form action="original.html" method="post">
<input type="text" name="email">
<input type="password" name="passwd">
<input type="submit" value="OK">
<input type="button" value="Forgot Passowrd" onClick="this.form.action='newpage.html';this.form.submit();">
</form>Jeremy Falcon Imputek "..." - Paul Watson 07-17
It works like a charm. That's excellent. Thanks.
-
I am wondering how (if it is possible) to do the following: You have a login form with a login ID (email address) and a password. When the user clicks the "Submit" button, go to a page that varifies the email address and password. That part I've got done -- easy. What I would like is to have another button, or a link, that will go to a different page that will send the user their password in an email. So what I'm wondering is how can this other page (the one sending the email) get the email address the user entered on the form? I would rather not simply redirect them to a second page where they enter the email address. If possible, I would like to be able to read the email address entered on the login form. Can it be done? If so, how? My understanding is that the data on the form is not available to subsequent pages until the form is submitted (which activates the "action" page, right?). Is there a way around that, or am I missing something basic? Thanks.
David Fleming wrote: I would rather not simply redirect them to a second page where they enter the email address. If possible, I would like to be able to read the email address entered on the login form. Can it be done? If so, how? Jeremy's way works well, but an alternative (always good to have options) is to have the FORM still go to the same handling ASP page, but also have a hidden text box in the FORM which tracks which button was clicked. Then in the ASP you can check which one was clicked and do whatever is appropriate. The benefit is that you can save some coding by having only one ASP page and not two. The down side is there is a bit more code (HTML and JavaScript) on the originating FORM page. If you need some help with the hidden text box method just ask... regards, Paul Watson Bluegrass Cape Town, South Africa The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge Alison Pentland wrote: I now have an image of you in front of the mirror in the morning, wearing your knickers, socks and shoes trying to decided if they match!
-
David Fleming wrote: I would rather not simply redirect them to a second page where they enter the email address. If possible, I would like to be able to read the email address entered on the login form. Can it be done? If so, how? Jeremy's way works well, but an alternative (always good to have options) is to have the FORM still go to the same handling ASP page, but also have a hidden text box in the FORM which tracks which button was clicked. Then in the ASP you can check which one was clicked and do whatever is appropriate. The benefit is that you can save some coding by having only one ASP page and not two. The down side is there is a bit more code (HTML and JavaScript) on the originating FORM page. If you need some help with the hidden text box method just ask... regards, Paul Watson Bluegrass Cape Town, South Africa The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge Alison Pentland wrote: I now have an image of you in front of the mirror in the morning, wearing your knickers, socks and shoes trying to decided if they match!
Ah, good idea. I've already coded it the other way, but thanks for the alternative. I agree, always good to have alternatives. I've used hidden text boxes but didn't even think of that.
-
I am wondering how (if it is possible) to do the following: You have a login form with a login ID (email address) and a password. When the user clicks the "Submit" button, go to a page that varifies the email address and password. That part I've got done -- easy. What I would like is to have another button, or a link, that will go to a different page that will send the user their password in an email. So what I'm wondering is how can this other page (the one sending the email) get the email address the user entered on the form? I would rather not simply redirect them to a second page where they enter the email address. If possible, I would like to be able to read the email address entered on the login form. Can it be done? If so, how? My understanding is that the data on the form is not available to subsequent pages until the form is submitted (which activates the "action" page, right?). Is there a way around that, or am I missing something basic? Thanks.
Specifying multiple actions from a single Form Warning: was one of my first attempts at javascript. May explode. cheers, Chris Maunder
-
Specifying multiple actions from a single Form Warning: was one of my first attempts at javascript. May explode. cheers, Chris Maunder
In theory, very similar to the first reply I got, in that you change the ".action" to the new page. But very slick. I also liked the idea one person, who wrote a message on the article's page, had about having a single function that takes a parameter that tells it which page to redirect to. Very nifty. Thanks everyone.
-
In theory, very similar to the first reply I got, in that you change the ".action" to the new page. But very slick. I also liked the idea one person, who wrote a message on the article's page, had about having a single function that takes a parameter that tells it which page to redirect to. Very nifty. Thanks everyone.
Yes - the guy "Mr Picky" is a mate of mine who wrote just to let me know that my code was messy and unweildy (What are friends for, eh? ;)) cheers, Chris Maunder