Click to See Complete Forum and Search --> : Form problems


inlimbo17
01-19-2004, 11:28 PM
Hi

Im having trouble posting the results of a form. The form consists of just some text entry fields that the user has to fill in. But it has one drop down box in the middle of these text fields which reloads the page with some different values if something is selected. The problem is that u cant submit the form because i have a form within a form. (The javascript drop down box within my form POST) How can I get around this problem. I want to post all the information including that which is selected in the drop down box.



#!/usr/bin/perl
print qq~Content-type:text/html\n\n~;

@values = split(/&/,$ENV{'QUERY_STRING'});
foreach $i (@values) {
($varname, $mydata) = split(/=/,$i);
}


print qq~
<HTML><HEAD><TITLE>My Page</TITLE>

<script language=JavaScript>
<!-- Script courtesy of Web-Source.net - Your Guide to Professional Web Site Design and Development
function Navigate() {
var number = NavSelect.selectedIndex;
location.href = NavSelect.options[number].value; }
// -->
</script>

</HEAD>
<BODY>

<form action="FormMail.pl" method="post">

Country u selected: $ENV{'QUERY_STRING'}

Name: <input name="name" size="20">
Surname:<input name="surname" size="20">
Country: <select name="NavSelect" onChange="Navigate(this.form)">
<OPTION VALUE="$ENV{SCRIPT_NAME}?Australia">Australia
<OPTION VALUE="$ENV{SCRIPT_NAME}?NZ" selected>New Zealand
</SELECT>
Phone:<input name="phone" size="20">
Address:<input name="address" size="20">
<INPUT type=image src="$imageSquareButtons/send.gif" border=0 name=submit></form>

</body></html>~;


Cheers
Mark