Skip to main content
December 28, 2006
Question

Two Actions on One Form

  • December 28, 2006
  • 5 replies
  • 623 views
I have a user registration form that, after validation, inserts all information into my user database. I'd like to add an action so that in addition to inserting the form into my database it adds the user into my email management system. The latter is done by calling (POST or GET) a jsp file at a particular URL. My understanding is that you can't have two actions on one forms and that you need to use CGI or perhaps javascript to make this happen. I'm lost from there and could appreciate someone pointing me in the right direction.

Thanks.
This topic has been closed for replies.

5 replies

January 2, 2007
Thanks for the feedback.
Inspiring
December 30, 2006
I have a similar issue (new to dreamweaver)

ASP VB Dreamweaver 8
I have a form with code that updates some sql tables with data from some
text fields

I have :

<td><input name="submit2" type="submit" value="Insert record" /></td>

which works fine.

I have added 2 browse buttons that browse to files and a button uploads them
to the server with:

<input name="submit" type="submit" value="Upload the files &gt;&gt;" />

The problem with the above is the client has to press 2 buttons. One to
update the databse & one to upload the files. I need to achieve this on one
button.

I do not understand what the syntax of submitting a form is.

Is there anyway to achive this or any simple examples to walk me through
what happens on a submit form?

Cheers

SteveW


"Julian Roberts" <nospam@charon.co.uk> wrote in message
news:en1lgj$ngd$1@forums.macromedia.com...
> In this particular case, you wouldn't really need to use javascript. You
> could do a HTTP post on the server. In ASP, one can use the MSXML object.
> The form can be posted to the destination URL without passing browser
> control.
>
> The use of javascript in a website is a bit more complex than saying "yes,
> it's a good idea" or "no, it's a bad idea". It depends on the nature of
> the pages. My own view is that public facing browsable by all pages don't
> really need to use too much javascript anyway to function. On the other
> hand, for intranets or member websites, it quite conceivable that the
> owner insist that users have javascript/cookies switched on. So, one can't
> really generalise.
>
> --
> Jules
> http://www.charon.co.uk/charoncart
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>
>
>


Inspiring
December 28, 2006
In this particular case, you wouldn't really need to use javascript. You
could do a HTTP post on the server. In ASP, one can use the MSXML object.
The form can be posted to the destination URL without passing browser
control.

The use of javascript in a website is a bit more complex than saying "yes,
it's a good idea" or "no, it's a bad idea". It depends on the nature of the
pages. My own view is that public facing browsable by all pages don't really
need to use too much javascript anyway to function. On the other hand, for
intranets or member websites, it quite conceivable that the owner insist
that users have javascript/cookies switched on. So, one can't really
generalise.

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004





Inspiring
December 28, 2006
.oO(WebZopp)

>Javascript is the easiest solution.

And the most unreliable.
One form, one action. Period.

>Create a function that changes the document.form.action into the new URL

Please do it right and use a server-side script. There you can do
anything you want.

Micha
Inspiring
December 28, 2006
.oO(WebZopp)

> You are right micha, to determine what action he wants you simply use a
>function.
> And stay away with this rubbish "people that have deactivated JS".

It's not rubbish, but a fact.

>YOU might
>have. But you will have acess to only 10% of the internet.

Every properly written website can be accessed without JS, which is just
as optional as CSS, Flash etc.

> The secret is the combination of JS and Server Scripts.

Exactly. Server-side for all the reliable and essential stuff, client-
side for gimmicks and nice-to-have features to improve convenience.

>Yes. You are right.
> We do this for over 16 years since now (yes I am one of the first
>Webprogrammers in Germany)

If you're German then you should know the word "Barrierefreiheit".

>and have no problems.

Sure, because why should users complain? They just move to another, more
friendly site.

> You seach for problems? You will find them!
> You search for solutions? No one tells you. They just give DONTS and Warnings.
>Pah!

Often a "don't" or a warning _is_ the solution.

Micha
Participant
December 28, 2006
Javascript is the easiest solution.

Create a function that changes the document.form.action into the new URL
Send me your code if you want.