473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Passing form variables

Hi,

I have a form with many fields. And then I thought I could have two other
forms similar but here is only the submit button visible.
What I want is: if the user click on a submit button on a hidden form the
information typed into the visible form is copied two the not
visible form and submitted.
This way I can submit the visible form to three pages depending on the form
submitted.

Is this possible?

Regards,

Sindre
Jul 23 '05 #1
2 1341
"sindre" <si******@c2i.net> wrote in message
news:4G********************@news000.worldonline.dk ...
Hi,

I have a form with many fields. And then I thought I could have two other
forms similar but here is only the submit button visible.
What I want is: if the user click on a submit button on a hidden form the
information typed into the visible form is copied two the not
visible form and submitted.
This way I can submit the visible form to three pages depending on the form submitted.

Is this possible?

Regards,

Sindre

Perhaps a variation of the following?

<html>
<head>
<title>forms.htm</title>
<script type="text/javascript">
function submits() {
var form1 = document.form1;
var form2 = document.form2;
var form3 = document.form3;
form1.Field2.value = form2.Field2.value;
form1.Field3.value = form3.Field3.value;
return true;
}
</script>
</head>
<body>
<form name="form1" onsubmit="return submits()">
<input type="text" name="Field1" value="1">
<input type="hidden" name="Field2" value="1">
<input type="hidden" name="Field3" value="1">
<br><input type="submit" value="Submit Form">
</form>
<form name="form2">
<input type="hidden" name="Field2" value="2">
</form>
<form name="form3">
<input type="hidden" name="Field3" value="3">
</form>
</body>
</html>
Jul 23 '05 #2
Perhaps a variation of the following?

<html>
<head>
<title>forms.htm</title>
<script type="text/javascript">
function submits() {
var form1 = document.form1;
var form2 = document.form2;
var form3 = document.form3;
form1.Field2.value = form2.Field2.value;
form1.Field3.value = form3.Field3.value;
return true;
}
</script>
</head>
<body>
<form name="form1" onsubmit="return submits()">
<input type="text" name="Field1" value="1">
<input type="hidden" name="Field2" value="1">
<input type="hidden" name="Field3" value="1">
<br><input type="submit" value="Submit Form">
</form>
<form name="form2">
<input type="hidden" name="Field2" value="2">
</form>
<form name="form3">
<input type="hidden" name="Field3" value="3">
</form>
</body>
</html>


Thank you, that helped me a lot. I could use this, in a rewritten way.

Sindre
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: TG | last post by:
Conditions: Register globals is set to on. Parse html as php is set to on. I have two forms OrderTest1 and OrderTest2 and need to be able to validate the data from OrderTest1 before passing to...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
5
by: Jack | last post by:
Hi, I need to pass multple variables in a link in order to go to a asp page with the two varables. The following are the values of the variables using response.write: <%'Response.Write Mypage...
2
by: Michael C | last post by:
What's the best wat to pass data between two separate forms. For instance, Form1 invokes Form2 like this: Form z = new Form2(); z.Show(); How can I pass back strings and boolean values from...
3
by: Maarten | last post by:
hi, how can i pass data from a parrentform to a childform and reverse or retreave data from a childform of the parentform and reverse. Regards Maarten
7
by: Khai | last post by:
First off, yes, I understand the crapload of tutorials out there, (well, rather, I understand there /are/ a crapload of tutorials out there), the problem is my comprehension. I'm trying to pass...
7
by: The Doctor | last post by:
A rather elementary question, In VB5, how can I pass a variable from one form to another?
6
by: coool | last post by:
Hi :) anyone knows how can I send variables from a php page to a form - i need to fill the form with these variables ? maybe using (the process of passing variables to other pages - through...
8
by: chimambo | last post by:
Hi All, I am trying to pass variables between two frames in PHP. I want to get a variable from F1 to F2 and the variable that is now in F2 should pass back the variable to F1 and call another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.