Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting values to pass from 1 form to another

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I'll post this one final time, and hope someone can come up with a good solution.

I've got a DBA admin back-end - Perl-based. When people enter a new database record (it's for a vendor directory), they enter 14 fields about a vendor to a cgi that processes the info. and inputs a database record. Within the html of the page for entering vendor information (name, address, etc.) I have a 3D array to pick what kind and sub-type of business this is - it's a <form> unto itself - so to get it in, I end the main <form>, do teh array, and then start the DBA form again. The problem is that the array is a form unto itself - and the cgi scripting will only process from the last <form action> -

Basically, can I embed a form like this, and pass all information through to the last input type=submit - with some kind of passed values script, or something.

Below is the code I'm referring to - you'll see that form <database_doctor.cgi> ends, then form <place> starts and ends (the 3D array) - then I have to submit it all to databasedoctor.cgi again - and it's only passing on the values from the last <form> . . . </form>

Really, I'm pulling my hair out over this one. Thanks in advance, mucho!



<html>
<head>
<title>Database Doctor 2.0</title>
<script>

//3D array info

CHINESE = new Array(&quot;Chinese Cuisine&quot;,&quot;a-00001&quot;)
DELIVERY = new Array(&quot;Delivery Food&quot;,&quot;b-00001&quot;)
DINER = new Array(&quot;Diners&quot;,&quot;c-00001&quot;)
FRENCH = new Array(&quot;French Cuisine&quot;,&quot;d-00001&quot;)
GREEK = new Array(&quot;Greek Cuisine&quot;,&quot;e-00001&quot;)
ITALIAN = new Array(&quot;Italian Cuisine&quot;,&quot;f-00001&quot;)
MEXICAN = new Array(&quot;Mexican Cuisine&quot;,&quot;g-00001&quot;)
MIDDLEEASTERN = new Array(&quot;Middleastern Cuisine&quot;,&quot;h-
00001&quot;)
SEAFOOD = new Array(&quot;Seafood&quot;,&quot;i-00001&quot;)
GALLERIES = new Array(&quot;Galleries&quot;,&quot;a-00002&quot;)
MOVIES = new Array(&quot;Movies&quot;,&quot;b-00002&quot;)
MUSEUMS = new Array(&quot;Museums & Exhibits&quot;,&quot;c-00002&quot;)
SPECIAL = new Array(&quot;Special Occasions&quot;,&quot;d-00002&quot;)
THEATRE = new Array(&quot;Theatre&quot;,&quot;e-00002&quot;)
BARS = new Array(&quot;Bars & Pubs&quot;,&quot;a-00003&quot;)
CLUBS = new Array(&quot;Dance & Night Clubs&quot;,&quot;b-00003&quot;)
GENERAL = new Array(&quot;General Shopping&quot;,&quot;a-10001&quot;)
WOMENS = new Array(&quot;Women's Fashion&quot;,&quot;b-10001&quot;)
MENS = new Array(&quot;Men's Fashion&quot;,&quot;c-10001&quot;)
SPORTSSHOPPING = new Array(&quot;Sports Apparel&quot;,&quot;d-
10001&quot;)
COMMERCIAL = new Array(&quot;Commercial Real Estate&quot;,&quot;a-
10002&quot;)
RESIDENTIAL = new Array(&quot;Residential Real
Estate&quot;,&quot;b-10002&quot;)
GOLFING2 = new Array(&quot;Area Golf Courses&quot;,&quot;a-20001&quot;)
BEACHES2 = new Array(&quot;Local Beaches&quot;,&quot;a-20002&quot;)
CHARTER_FISHING = new Array(&quot;Charter Fishing&quot;,&quot;a-
20003&quot;)
PARASAILING = new Array(&quot;Parasailing&quot;,&quot;b-20003&quot;)
RENTALS = new Array(&quot;Marine Rentals&quot;,&quot;c-20003&quot;)
TOURS = new Array(&quot;Tours&quot;,&quot;a-20004&quot;)
ESTUARIES = new Array(&quot;Estuaries&quot;,&quot;b-20004&quot;)
GYMS2 = new Array(&quot;Gyms & Workout Facilities&quot;,&quot;a-
20005&quot;)
AFFORDABLE = new Array(&quot;Affordable Car Rentals&quot;,&quot;a-
30001&quot;)
LUXURY = new Array(&quot;Luxury Car Rentals&quot;,&quot;b-30001&quot;)
TAXIS2 = new Array(&quot;Taxi Services&quot;,&quot;a-30002&quot;)
LIMOS2 = new Array(&quot;Limousine Services&quot;,&quot;a-30003&quot;)
HISTORICAL2 = new Array(&quot;Historical Sites &
Landmarks&quot;,&quot;a-40001&quot;)
DAYCARE = new Array(&quot;Child Day Care&quot;,&quot;a-40002&quot;)
AMUSEMENT = new Array(&quot;Amusement Parks, etc.&quot;,&quot;b-
40002&quot;)
CHRISTIAN = new Array(&quot;Christian&quot;,&quot;a-40003&quot;)
JEWISH = new Array(&quot;Jewish&quot;,&quot;b-40003&quot;)
ISLAM = new Array(&quot;Islam&quot;,&quot;c-40003&quot;)
OTHER = new Array(&quot;Other&quot;,&quot;d-40003&quot;)

DININGOUT = new Array(&quot;Dining
Out&quot;,CHINESE,DELIVERY,DINER,FRENCH,GREEK,ITALIAN,MEXICAN,MID
DLEEASTERN,SEAFOOD)
ENTERTAINMENT = new Array(&quot;Entertainment &
Arts&quot;,MOVIES,THEATRE,MUSEUMS,SPECIAL,GALLERIES)
LATENIGHT = new Array(&quot;Late Night
Activities&quot;,BARS,CLUBS)
SHOPPING = new Array
(&quot;Shopping&quot;,GENERAL,WOMENS,MENS,SPORTSSHOPPING)
REALESTATE = new Array(&quot;Local Real
Estate&quot;,COMMERCIAL,RESIDENTIAL)
GOLFING = new Array(&quot;Golfing&quot;,GOLFING2)
BEACHES = new Array(&quot;Beaches&quot;,BEACHES2)
MARINE = new Array(&quot;Marine
Activities&quot;,CHARTER_FISHING,PARASAILING,RENTALS)
OUTDOORS = new Array(&quot;Outdoors
Adventure&quot;,TOURS,ESTUARIES)
GYMS = new Array(&quot;Gyms & Workout Facilities&quot;,GYMS2)
CARS = new Array(&quot;Car Rentals&quot;,AFFORDABLE,LUXURY)
TAXIS = new Array(&quot;Taxi Companies&quot;,TAXIS2)
LIMOS = new Array(&quot;Limosusine Services&quot;,LIMOS2)
HISTORICAL = new Array(&quot;Historical Sites &
Landmarks&quot;,HISTORICAL2)
CHILDREN = new Array(&quot;Children's
Activities&quot;,DAYCARE,AMUSEMENT)
RELIGIOUS = new Array(&quot;Religious Activities &
Spiritual Organizations&quot;,CHRISTIAN,JEWISH,ISLAM,OTHER)
Place = new Array
(&quot;&quot;,DININGOUT,ENTERTAINMENT,LATENIGHT,SHOPPING,REALESTATE,GO
LFING,BEACHES,MARINE,OUTDOORS,GYMS,CARS,TAXIS,LIMOS,HISTORIC
AL,CHILDREN,RELIGIOUS)

DININGOUT_ID = new Array(CHINESE[0],DELIVERY
[0],DINER[0],FRENCH[0],GREEK[0],ITALIAN[0],MEXICAN
[0],MIDDLEEASTERN[0],SEAFOOD[0])
ENTERTAINMENT_ID = new Array(MOVIES[0],THEATRE
[0],MUSEUMS[0],SPECIAL[0],GALLERIES[0])
LATENIGHT_ID = new Array(BARS[0],CLUBS[0])
SHOPPING_ID = new Array(GENERAL[0],WOMENS[0],MENS
[0],SPORTSSHOPPING[0])
REALESTATE_ID = new Array(COMMERCIAL[0],RESIDENTIAL
[0])
GOLFING_ID = new Array(GOLFING2[0])
BEACHES_ID = new Array(BEACHES2[0])
MARINE_ID = new Array(CHARTER_FISHING[0],PARASAILING
[0],RENTALS[0])
OUTDOORS_ID = new Array(TOURS[0],ESTUARIES[0])
GYMS_ID = new Array(GYMS2[0])
CARS_ID = new Array(AFFORDABLE[0],LUXURY[0])
TAXIS_ID = new Array(TAXIS2[0])
LIMOS_ID = new Array(LIMOS2[0])
HISTORICAL_ID = new Array(HISTORICAL2[0])
CHILDREN_ID = new Array(DAYCARE,AMUSEMENT[0])
RELIGIOUS_ID = new Array(CHRISTIAN[0],JEWISH
[0],ISLAM[0],OTHER[0])
PLACE_ID = new Array
(DININGOUT_ID,ENTERTAINMENT_ID,LATENIGHT_ID,SHOPPING_ID,REAL
ESTATE_ID,GOLFING_ID,BEACHES_ID,MARINE_ID,OUTDOORS_ID,GYMS_I
D,CARS_ID,TAXIS_ID,LIMOS_ID,HISTORICAL_ID,CHILDREN_ID,RELIGI
OUS_ID)



function changevendor_type() {
selected_vendor_type =
document.place.vendor_type.selectedIndex + 1
selected_vendor_type_specific =
document.place.vendor_type_specific.selectedIndex + 1
num_vendor_type_specific = Place
[selected_vendor_type].length-1
num_vendor_type_number = Place[selected_vendor_type]
[selected_vendor_type_specific].length-1
CountryOptionsLength =
document.place.vendor_type_specific.length
CityOptionsLength =
document.place.vendor_type_number.length


for (i=CountryOptionsLength-1; i>0; i--) document.place.vendor_type_specific.options =
null;
for (i=0; i<num_vendor_type_specific; i++)
document.place.vendor_type_specific.options = new Option
(PLACE_ID[selected_vendor_type-1])

for (j=CityOptionsLength-1; j>0; j--)
document.place.vendor_type_number.options[j] = null;
for (j=0; j<num_vendor_type_number; j++)
document.place.vendor_type_number.options[j] = new Option
(Place[selected_vendor_type][selected_vendor_type_specific]
[j+1])

}


function changevendor_type_specific() {
selected_vendor_type =
document.place.vendor_type.selectedIndex + 1
selected_vendor_type_specific =
document.place.vendor_type_specific.selectedIndex + 1
num_vendor_type_number = Place[selected_vendor_type]
[selected_vendor_type_specific].length-1
CityOptionsLength =
document.place.vendor_type_number.length

for (j=CityOptionsLength-1; j>0; j--)
document.place.vendor_type_number.options[j] = null;
for (j=0; j<num_vendor_type_number; j++)
document.place.vendor_type_number.options[j] = new Option
(Place[selected_vendor_type][selected_vendor_type_specific]
[j+1])

}


function SetDefault() {
selected_vendor_type =
document.place.vendor_type.selectedIndex + 1
selected_vendor_type_specific =
document.place.vendor_type_specific.selectedIndex + 1
num_vendor_type_specific = Place
[selected_vendor_type].length-1
num_vendor_type_number = Place[selected_vendor_type]
[selected_vendor_type_specific].length-1

for (i=0; i<num_vendor_type_specific; i++)
document.place.vendor_type_specific.options = new Option
(PLACE_ID[selected_vendor_type-1])
for (j=0; j<num_vendor_type_number; j++)
document.place.vendor_type_number.options[j] = new Option
(Place[selected_vendor_type][selected_vendor_type_specific]
[j+1])

}

</script>


</head>

<BODY basefont=-1>

<body onload=&quot;SetDefault()&quot;>

<a href=&quot;src=&quot;alt=&quot;Database Doctor&quot; border=0></a><P>


##start first form


<FORM method=post action=&quot;database_doctor.cgi&quot;>

<INPUT type=&quot;hidden&quot; name=&quot;password&quot; Value=&quot;gdthree&quot;>

<INPUT type=&quot;hidden&quot; name=&quot;user&quot; Value=&quot;altaratz&quot;>
<center><table border=1 WIDTH=&quot;70%&quot; BGCOLOR=&quot;#F8F1F1&quot;>

<tr><td colspan=2
BGCOLOR=&quot;#D5E6E1&quot;><center><B><FONT COLOR=&quot;#000000&quot;
size=&quot;+1&quot;>New Entry Form</FONT></center></B>
</td></tr>

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Individual Vendor ID Number (add '1' to
previous)</a></td>
<td><input type=text name=&quot;vendor_number&quot;
size=25></td></tr>

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Vendor Name</a></td>
<td><input type=text name=&quot;vendor_name&quot;
size=25></td></tr>

</form>


##end first form

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Vendor Types & Number</a></td>


##start second form



<form name=&quot;place&quot;>
<td> <select name=&quot;vendor_type&quot;
onchange=&quot;changevendor_type()&quot;>
<option>Dining Out</option>
<option>Entertainment & Arts</option>
<option>Late Night Activities</option>
<option>Shopping</option>
<option>Local Real Estate</option>
<option>Golfing</option>
<option>Beaches</option>
<option>Marine Activities</option>
<option>Outdoors Adventure</option>
<option>Gyms & Workout Facilities</option>
<option>Car Rentals</option>
<option>Taxi Companies</option>
<option>Limosusine Services</option>
<option>Historical Sites &
Landmarks</option>
<option>Children's Activities</option>
<option>Religious Activities & Spiritual
Organizations</option>
</select>
<br>
<br>
<br>
<select name=&quot;vendor_type_specific&quot;
onchange=&quot;changevendor_type_specific()&quot;>
<option></option>
</select>
<br>
<br>
<br>
<select name=&quot;vendor_type_number&quot;>
<option></option>
</select>


</form>


##end second form


##start original form again


<FORM method=post action=&quot;database_doctor.cgi&quot;>


<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Full Path To Image for Banner
Advertisement</a></td>
<td><input type=text name=&quot;banner&quot; size=25
value=

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Email</a></td>
<td><input type=text name=&quot;address&quot;
size=25></td></tr>

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>City</a></td>
<td><input type=text name=&quot;city&quot; size=25></td></tr>

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>State</a></td>
<td><select name=&quot;state&quot;>

<option value=&quot;99&quot;>Please Select:</option>
<option value=&quot;AL&quot;>Alabama</option>
<option value=&quot;AK&quot;>Alaska</option>
<option value=&quot;AZ&quot;>Arizona</option>
<option value=&quot;AR&quot;>Arkansas</option>
<option value=&quot;CA&quot;>California</option>
<option value=&quot;CO&quot;>Colorado</option>
<option value=&quot;CT&quot;>Connecticut</option>
<option value=&quot;DC&quot;>D.C.</option>
<option value=&quot;DE&quot;>Delaware</option>
<option value=&quot;FL&quot;>Florida</option>
<option value=&quot;GA&quot;>Georgia</option>
<option value=&quot;HI&quot;>Hawaii</option>
<option value=&quot;ID&quot;>Idaho</option>
<option value=&quot;IL&quot;>Illinois</option>
<option value=&quot;IN&quot;>Indiana</option>
<option value=&quot;IA&quot;>Iowa</option>
<option value=&quot;KS&quot;>Kansas</option>
<option value=&quot;KY&quot;>Kentucky</option>
<option value=&quot;LA&quot;>Louisiana</option>
<option value=&quot;ME&quot;>Maine</option>
<option value=&quot;MD&quot;>Maryland</option>
<option value=&quot;MA&quot;>Massachusetts</option>
<option value=&quot;MI&quot;>Michigan</option>
<option value=&quot;MN&quot;>Minnesota</option>
<option value=&quot;MS&quot;>Mississippi</option>
<option value=&quot;MO&quot;>Missouri</option>
<option value=&quot;MT&quot;>Montana</option>
<option value=&quot;NE&quot;>Nebraska</option>
<option value=&quot;NV&quot;>Nevada</option>
<option value=&quot;NH&quot;>New Hampshire</option>
<option value=&quot;NJ&quot;>New Jersey</option>
<option value=&quot;NM&quot;>New Mexico</option>
<option value=&quot;NY&quot;>New York</option>
<option value=&quot;NC&quot;>North Carolina</option>
<option value=&quot;ND&quot;>North Dakota</option>
<option value=&quot;OH&quot;>Ohio</option>
<option value=&quot;OK&quot;>Oklahoma</option>
<option value=&quot;OR&quot;>Oregon</option>
<option value=&quot;PA&quot;>Pennsylvania</option>
<option value=&quot;RI&quot;>Rhode Island</option>
<option value=&quot;SC&quot;>South Carolina</option>
<option value=&quot;SD&quot;>South Dakota</option>
<option value=&quot;TN&quot;>Tennessee</option>
<option value=&quot;TX&quot;>Texas</option>
<option value=&quot;UT&quot;>Utah</option>
<option value=&quot;VT&quot;>Vermont</option>
<option value=&quot;VA&quot;>Virginia</option>
<option value=&quot;WA&quot;>Washington</option>
<option value=&quot;WV&quot;>West Virginia</option>
<option value=&quot;WI&quot;>Wisconsin</option>
<option value=&quot;WY&quot;>Wyoming</option>
</select></td></tr>


<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Phone Number</a></td>
<td><input type=text name=&quot;phone&quot; size=25></td></tr>

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Contact Email Address</a></td>
<td><input type=text name=&quot;email&quot; size=25></td></tr>

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Full Website URL</a></td>
<td><input type=text name=&quot;url&quot; size=25
value=
<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Does the vendor offer any special
discounts?</a></td>
<td><select name=&quot;discount_huh&quot;>
<option value=&quot;no&quot;>No</option>
<option value=&quot;yes&quot;>Yes</option>
</select>

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Available discount(s)</a></td>
<td><input type=text name=&quot;discount&quot; size=50
value=&quot;Sorry, no discounts available for this
vendor&quot;></td></tr>

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Full Text for Pop-up Ad</a></td>
<td><input type=text name=&quot;perma_tip&quot;
size=25></td></tr>

<tr><td align=center WIDTH=&quot;200&quot;
BGCOLOR=&quot;#F8F1F1&quot;>Full Path to Image File for Pop-up
Ad</a></td>
<td><input type=text name=&quot;perma_ad&quot; size=25
value=

</table>
<P></center>


##submit


<center><P><INPUT type=&quot;submit&quot; name=&quot;add&quot; Value=&quot; Add
this directly to the Database &quot;>

<center><INPUT type=&quot;submit&quot; name=&quot;preview&quot; Value=&quot;
Preview &quot;><P>

<center>
<P><hr><p>
<center><P><INPUT type=&quot;Submit&quot; name=&quot;startup&quot;
Value=&quot; Enter New Items Form&quot;>
<INPUT type=&quot;Submit&quot; name=&quot;edit&quot; Value=&quot; Edit
the Database &quot;>

<INPUT type=&quot;Submit&quot; name=&quot;sort&quot; Value=&quot; Sort
the Database &quot;><P>
<INPUT type=&quot;Submit&quot; name=&quot;search&quot; Value=&quot;
Search the Database &quot;>
<INPUT type=&quot;Submit&quot; name=&quot;print&quot; Value=&quot;
Prepare a Printout &quot;><p>
<a href=&quot;display.cgi&quot; target=&quot;_new&quot;>See the Data in
Display.cgi Front End</a><p>
<!-- START ADCYCLE.COM IFRAME RICH MEDIA CODE -->
<!-- © 2000 AdCycle.com All Rights Reserved. -->
<iframe
src=&quot;group=6&media=1&id=1&delivery=iframe&quot; height=60 width=468
border=0 marginheight=0 scrolling=no marginwidth=0
frameborder=no>
<a
href=&quot;manager=adcycle.com&id=1&quot; target=&quot;_top&quot;><img
src=&quot;group=6&media=1&id=1&quot; width=468 height=60 border=1
ALT=&quot;Click to Visit&quot;></a>
</iframe>
<!-- END ADCYCLE.COM IFRAME RICH MEDIA CODE -->
<center>
<p><font color=&quot;#000000&quot;><font size=-2>Copyright
(c) 1997-2000 <a href=&quot; Web
Bazaar</a> Database Doctor.
<br>All rights reserved. Reproduction in whole or
in part in any form or medium
<br>without express written permission of The Web
Bazaar is prohibited.</font></font></center>

</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top