...

View Full Version : how to submit two forms at same time?



NinjaTurtle
01-14-2003, 08:18 AM
dear,

i have two forms: Form1 & Form2 in a same file(abc.asp), another page(xyz.asp) is to capture the value that pass from abc.asp

<Form name=Form1 action="abc.asp">
<Select size=1 name=test onchange="document.form1.submit()">
<option value=1>1</option>
<option value=2>2</option>
</select>
<input type=text name=Description>
</Form>


<Form name=Form2 action="xyz.asp">
<input type=text name=password>

<input type=submit name=OK value=ok>
</Form>
---- Just an simply example ---

WHen user select the drop down list the FORM1 will refresh and pas the value to Description text box. Then user need to key in the value of the Password into the text box. Then press OK button the value of FORM1 and FORM2 will pass to next page(xyz.asp)....

allida77
01-14-2003, 02:19 PM
If I understand your question I dont think you need 2 forms, just set your form action with js.
<Select size=1 name=test onchange="document.form1.action='abc.asp';document.form1.submit()">

Change the action in your submit button to 'xyz.asp' the same way as above.

NinjaTurtle
01-15-2003, 01:13 AM
yes i need to, bcos i am using <Form enctype="multipart/form-data"> in one of my form. i cannot get both form value to the next asp page.

whammy
01-15-2003, 01:14 AM
This is a common problem with upload components in ASP, if I get the gist of your post.

I'm not quite sure how to solve the problem with two forms (as I've read, it's a common problem) however you might be better off using a free upload component that solves this problem with one form such as one at http://www.dundas.com

:)

NinjaTurtle
01-15-2003, 01:18 AM
if pple can write the component, then there must be a way.
the problem is my company not allow me to use other third party component... that's y i so headache!!!

NinjaTurtle
01-15-2003, 01:30 AM
if pple can write the component, then there must be a way.
the problem is my company not allow me to use other third party component... that's y i so headache!!!

whammy
01-15-2003, 01:36 AM
They won't even let you use a free one? We use that at work, and my company is really bad about that stuff! :)

There IS a way, and I've seen a tutorial on it, but I don't have it handy, so you might want to do soem searches of google, etc... (not to mention a search of the ASP forum, I know that references have been posted before to this, but I can't find any offhand). :(

NinjaTurtle
01-15-2003, 01:44 AM
bcos of some security problem so they dun allow use to use DLL...
and i m not so strong in DLL so that i cant say anything.... :(

i do research 4 few weeks already but still cannt get. but i can alot of knowledge on that, i will try to write my own just stuck at some places... i think i will do a pretty "dumb" way... hihihiihii, pass all the value from form1 to form2.
:p

whammy
01-16-2003, 12:30 AM
Well, if it works, it's not necesarily "dumb"... :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum