two ACTIONs for one Form?

kilowatt

mach-o mach-o man
I have a situation, in a php-based web mail agent called "Squirl Mail", in which we support ssl and non-ssl connections.

I would like to place two buttons at the bottom of the login page, one for ssl login, and one for non-ssl.

However, I can find no method to place two submit buttons, each with a different ACTION (ACTION="http://domain/src/redirect.php" METHOD="POST" and ACTION="https://domain/src/redirect.php" METHOD="POST").

We're actually going to have three different options - one to only encrypt the authentication, one for pure ssl, and one for plain text.

These all work fine, when I created seperate login.php pages, each with different form actions.

I've thought about nested forms, but I don't think thats to spec.

Any ideas?

Thanks!
 
well, did some thinking, and decided to just add a radio button for the option, and have the next php script validate the choice.

Still wondering though, if I could have done it the other way.
 
I was going to suggest that, though I have seen pages with multiple submit buttons. You might need to use two separate forms on a page, one with SSL login and one with non-SSL login (and one for encryption, perhaps).
 
If I remember right the URL you are posting to is an attribute of the form tag and not the button. (I am not at the right computer to check at the moment...) If that is the case you cannot have two buttons in the same form submit to different URLs but one thing you can do is set the value or tag to somethign different for each button and then redirect as appropriate. You don't need the radio buttons in that case.

-Eric
 
Back
Top