Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-09-2003, 11:23 PM   PM User | #1
mr_mak
New to the CF scene

 
Join Date: Jun 2002
Location: Australia
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
mr_mak is an unknown quantity at this point
Unhappy Dynamic Forms

I am having difficulty writing a JS which creates a dynamic
form containing all the combined input parameters of all forms
existing in a page. The purpose of such a form is to make all parameters on the page available to a common server side routine that is actioned when submit is called on the dynamic form.

Haven't written any code yet as I'm not sure how to approach such a problem.
Any help will be appreciated.

Last edited by mr_mak; 07-09-2003 at 11:37 PM..
mr_mak is offline   Reply With Quote
Old 07-09-2003, 11:29 PM   PM User | #2
scroots
Senior Coder

 
Join Date: Jun 2002
Location: UK
Posts: 1,137
Thanks: 0
Thanked 0 Times in 0 Posts
scroots is an unknown quantity at this point
what is your current code? if you post it, the code can be adpated and you can leanr were you are going wrong.

scroots
__________________
Spammers next time you spam me consider the implications:
(1) that you will be persuaded by me(in a legitimate mannor)
(2)It is worthless to you, when i have finished
scroots is offline   Reply With Quote
Old 07-11-2003, 06:55 AM   PM User | #3
Harry
New Coder

 
Join Date: Jul 2003
Location: Houston, Texas
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Harry is an unknown quantity at this point
I hope this will help you. I have a page with 6 forms on it
and I submit them all with one button using the following script
I have included part of my HTML code that shows six forms
where I enter data and the seventh form combines all of them
and is submitted. Please note where I placed the submit button.
the seventh form contains all hidden inputs with all the
fields that are on the other six forms.

Hope this is what you need.


<head>
<SCRIPT LANGUAGE="JavaScript">
function copydata()
{
document.formg.text_one.value = document.forma.text_one.value;
document.formg.a_type.value = document.forma.a_type.value;
document.formg.rq_name.value = document.forma.rq_name.value;
document.formg.fl_name.value = document.forma.fl_name.value;
document.formg.emp_stat.value = document.forma.emp_stat.value;
document.formg.emp_id.value = document.forma.emp_id.value;
document.formg.bus_unit.value = document.forma.bus_unit.value;
document.formg.dpt.value = document.forma.dpt.value;
document.formg.brfr.value = document.forma.brfr.value;
document.formg.tt.value = document.forma.tt.value;
document.formg.text_two.value = document.formb.text_two.value;
document.formg.text_three.value = document.formc.text_three.value;
document.formg.text_four.value = document.formd.text_four.value;
document.formg.text_five.value = document.forme.text_five.value;
document.formg.text_six.value = document.formf.text_six.value;
document.formg.oa_0.value = document.formf.oa_0.value;
document.formg.submit();
return false;
}
</SCRIPT>

</head>


<form name='forma' onSubmit='return copydata()'>
<form name='formb' onSubmit='return copydata()'>
<form name='formc' onSubmit='return copydata()'>
<form name='formd' onSubmit='return copydata()'>
<form name='forme' onSubmit='return copydata()'>
<form name='formf' onSubmit='return copydata()'>
<input type='submit'>

<form name="formg" action="yourpage.php" method="post">
<input type="hidden" name="text_one">
<input type="hidden" name="text_two">
<input type="hidden" name="text_three">
<input type="hidden" name="text_four">
<input type="hidden" name="text_five">
<input type="hidden" name="text_six">
<input type="hidden" name="a_type">
<input type="hidden" name="rq_name">
<input type="hidden" name="fl_name">
<input type="hidden" name="emp_stat">
<input type="hidden" name="emp_id">
<input type="hidden" name="bus_unit">
<input type="hidden" name="dpt">
<input type="hidden" name="brfr">
<input type="hidden" name="tt">
<input type="hidden" name="oa_0">

</form>
__________________
Beyond a critical point within a finite space, freedom diminishes as numbers increase. ...The human question is not how many can possibly survive within the system, but what kind of existence is possible for those who do survive."
Harry is offline   Reply With Quote
Old 07-11-2003, 09:33 AM   PM User | #4
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
After a quick wiew... I wonder... Why not using a single form?... You may send the all values to the JavaScript function within a single button and use return false and return true to verify values and send them to the CGI when all correct...
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:23 AM.


Advertisement
Log in to turn off these ads.