File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Need to make 2 actions in 1 form w/1 button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need to make 2 actions in 1 form w/1 button" Watch "Need to make 2 actions in 1 form w/1 button" New topic

Need to make 2 actions in 1 form w/1 button

Eloine Chapman

Joined: Feb 10, 2005
Posts: 2
I know extremly little about java script but I think this may be the way to go. Forgive me if this is too lame a question or too hard a question because like I said I have no clue.

I have a form that sends data to a filemaker database. I have another form that send the info to an ASP script that sends out an email. I would like to combine the actions into one form so it will send the info both to the filemaker database and also send an email. I've seen a couple of java examples that kind of do this but they have two buttons and that won't work for what I need. I assumed that you could just combine the actions but when I try only one or the other will work. Below is the example of the two I want to combine.

<INPUT TYPE="hidden" NAME="-db" VALUE="infomail.fp3">
<input type="hidden" name="-mailformat" value="Formatmusic.txt">
<input type="hidden" name="-Format" value="redirectmusic.htm">
<INPUT TYPE="hidden" NAME="area" VALUE="music">

and THAT:
<form name="form1" method="post" action="dNBmail-noformat.asp">
<input name="_recipient" type="hidden"value=";">
<input name="_subject" type="hidden" value="Questions from the LMC website">
<input name="_redirect" type="hidden" value="">
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
The moderator might move your forum to the JavaScript forum since your post doesn't really relate to Java (it would if you were using Java/JSP instead of ASP). It sounds like you'll need to just have one form on the page (combine the two), and when that gets submitted it gets handled by some ASP code that both sends out the email and sends the data to FileMaker.
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
According to my experiences in my projects, that should be 2 buttons to handle that separately.
But if you want users to just click one button to do both actions, I think you should handle that in server side.

I ussually using a servlet to handle that. After that servlet receives a request, that servlet will execute both actions before that servlet returns HTTP Response.

Correct me if I am wrong to understand your question

Eloine Chapman

Joined: Feb 10, 2005
Posts: 2
Thanks very much for your responses I was hoping to combine the two forms somehow with java script but I'm not really familiar with hodw to do it. I think you're right it needs to be a server side thing that handles the flow of being sent to an email and into a database. Our Filemaker used to do that and then SMTP on that box was turned off so I was using an ASP script on another box and hoping to combine the actions of the two since one I have SMTP access on one and the other I have a database. Getting a bit complicated!
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Please direct further questions to the HTML and JavaScript forum. This forum is about Java (which is NOT the same as JavaScript, nor even related).



Java API Documentation
The Java Tutorial
I agree. Here's the link:
subject: Need to make 2 actions in 1 form w/1 button
It's not a secret anymore!