Code:
QUOTE
#!/usr/bin/perl -w
use CGI;
$query = new CGI;
$JSCRIPT=<<EOF;
// Any JavaScript Ideas??
EOF
;
print $query->header,"\n";
print $query->start_html(-title=>'JavaScript Summations',-script=>$JSCRIPT),"\n";
print "<h1>Choose to add up a Summation of costs</h1>\n";
print $query->p,
"Just enter in the number of items you will need to include then hit "Submit Query" to get the form boxes","\n";
print $query->start_form(-name=>'formA',
-method=>'get'),"\n";
print "<p>How many items?\n";
print $query->textfield('item'),"<br />\n";
print $query->submit,$query->reset,"</p>\n";
$list = $query->param('item');
print "<ol>\n";
for (1..$list) {
print qq{ <li>Input a cost(\$): <input name=\"field$_\" type=\"text\" /></li>\n};
}
print "</ol>\n\n";
print "<input type=\"button\" value=\"Get Sum\" onclick=\"doSum()\" \/>\n\n";
print $query->end_form,"\n\n";
print $query->end_html;
use CGI;
$query = new CGI;
$JSCRIPT=<<EOF;
// Any JavaScript Ideas??
EOF
;
print $query->header,"\n";
print $query->start_html(-title=>'JavaScript Summations',-script=>$JSCRIPT),"\n";
print "<h1>Choose to add up a Summation of costs</h1>\n";
print $query->p,
"Just enter in the number of items you will need to include then hit "Submit Query" to get the form boxes","\n";
print $query->start_form(-name=>'formA',
-method=>'get'),"\n";
print "<p>How many items?\n";
print $query->textfield('item'),"<br />\n";
print $query->submit,$query->reset,"</p>\n";
$list = $query->param('item');
print "<ol>\n";
for (1..$list) {
print qq{ <li>Input a cost(\$): <input name=\"field$_\" type=\"text\" /></li>\n};
}
print "</ol>\n\n";
print "<input type=\"button\" value=\"Get Sum\" onclick=\"doSum()\" \/>\n\n";
print $query->end_form,"\n\n";
print $query->end_html;
This is like my second serious Perl script and I couldn't think of the syntax that would accomplish my task--I wouldn't even know how to search for it really, but I'll continue to play around with ideas. Thanks, in advance, for any help.
Best regards,
ezincenter

