Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Eloine Chapman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

THIS:
<FORM ACTION="FMPro" METHOD="post">
<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="lmcquestions@losmedanos.edu; echapman@losmedanos.edu">
<input name="_subject" type="hidden" value="Questions from the LMC website">
<input name="_redirect" type="hidden" value="http://www.losmedanos.edu">
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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

thanks
daniel
 
Eloine Chapman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).

Thanks,

Layne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic