[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

two ACTIONs

Posted on 2000-03-02
12
Medium Priority
?
210 Views
Last Modified: 2013-12-25
Can I have two actions in <form ACTION.....> tag
Example
<form action="/cgi-bin/account_request.pl" now anotherone>
explanation: need to execute completely different programs from
data input form (cgi and ASP)
Please supply correct syntax if any or workaround.
Thanks
0
Comment
Question by:mativare
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
12 Comments
 

Expert Comment

by:lorentg
ID: 2578760
Not as such
0
 

Expert Comment

by:lorentg
ID: 2578763
PS - the html spec is clear that there is only one action for a <form tag>  

Now, there are kludges that can be used to make it appear that there are two actions.  The most commone ones are:

a) have the script called by the first action make a page that includes a <meta tag, or javascript that invokes the second.

b) have the submit button actually invoke a JS function rather than really do the submit.  Then the function does the submit after doing a form.submit() in another, hidden window for the other action.
0
 
LVL 1

Author Comment

by:mativare
ID: 2580320
Please supply JavaScript example how to do it
<form action="/cgi-bin/account_request.pl" + x.asp>
Thanks
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:jhurst
ID: 2581406
Here are three html files:

test.htm will create a minimal size/not visible frame at the top and the one you see at the bottom:

<html>
<frameset rows=200,*>
<frame src=test2.htm>
<frame src=test1.htm>
</frameset>
</html>


test1.htm:
appears in the bottom/visible frame and does the work
<HTML>
<script>
function Touched()
  {
  parent.frames[1].document.forms[0].submit();
  parent.frames[0].document.forms[0].submit();
  }
</script>
<BODY>
<!-- do the post that he does see -->
<form action=http://www.altavista.digital.com>
<input type=button value="Touch here to do double post" onClick=Touched()>
</form>
</body>
</html>

test2.htm:
Goes in the top frame and just allows for the other submit:
<HTML>
<BODY>
<form name=theForm action=http://www.yahoo.com/>
This form will be invisible since it is bigger than one pixel
<input type=submit >
</form>
</body>
</html>
0
 
LVL 8

Expert Comment

by:jhurst
ID: 2581421
the above will of course just do a pair of submissions that bring up the pages shown.  You need to replace the action with whatever you want.
0
 
LVL 8

Expert Comment

by:jhurst
ID: 2581550
By the way, in my test.htm I allow the top farem to be 100 so that you can see it.  It should be set as 1, so as not to show.
0
 
LVL 1

Author Comment

by:mativare
ID: 2582213
Adjusted points to 200
0
 
LVL 1

Author Comment

by:mativare
ID: 2582214
Lets make sure we understand each other correctly
I have data input form lot of text boxes
I want to insert them into diferent systems
(Unix and NT)
Your explanation works 50% only
it posts test1.htm very good
now my test2.htm needs to post to x.asp
lets look inside x.asp in order to understand
it uses

y=request.Querystring("fieldfromtest1needed")

but nobody filled out y on test2.htm it is empty
because invisible

see it wants info written on test1.htm
nobody wrote things to test2.html
so your programs second part has nothing to
POST and it does nothing

I want to see y from test1.htm in order
to POST on test2.htm (across html files)
Global variables or something
Please supply workaround.


0
 
LVL 9

Expert Comment

by:TTom
ID: 2584103
I think you have two choices.  You can either create hidden varibles in one of your forms and, when the other is submitted, transfer your data (via JavaScript) to the fields on the other form before the submission, OR you can do a "sequential submit", making the response from the first form into a second form which submits itself as soon as it is loaded.

Hope this makes sense, as I am jumping in to the discussion a bit late.

Tom
0
 
LVL 8

Accepted Solution

by:
jhurst earned 600 total points
ID: 2584128
Just have the form on the hidden frame also and have your function copy the values from the one form that as filled in to the same values in the other one before doing the submit.

This like:
parent.frames[0].document.form[0].varable1.value=
  parent.frames[1].document.form[0].varable1.value;

etc.
0
 
LVL 1

Author Comment

by:mativare
ID: 2588510
Now I understand your idea clearly
java function now looks like
  function Touched()
                     {
parent.frames[0].document.form[0].contact_fname.value=parent.frames[1].document.form[1].contact_fname.value
                   parent.frames[1].document.forms[0].submit();
                    parent.frames[0].document.forms[0].submit();
                     }
where contact_fname is input name in visible frame
duplicate form is on invisible frame too now
first line of code gives me error(where I try contact_fname=contact_fname)
without this first line it works
please help to fix syntax
seems frames[1] is visible where data actually submitted.
my main form is
 <html>
                   <frameset rows=1,*>
                   <frame src=phantom.html>
                   <frame src=account_request.html>
                   </frameset>
                   </html>
0
 
LVL 8

Expert Comment

by:jhurst
ID: 2588644
First, this is Javascript not Java.  Second, I think that in your assignment you have form[1] instead of form[0].  Note the form is still the first form in that window, unless you actually have more than one form in that window.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question