Re: Counting the number of form fields returned with information

2002-04-18 Thread Teresa Raymond
#no checkboxes# my %params = $q->Vars; foreach my $i (keys %params) {if ($params{$i} eq "" || $params{$i} eq " ") {print <<"PrintTag"; Error! Alert! I'm sorry but all fields need to be filled out except the check boxes. Please push the back button on your browser and try again. PrintT

Re: Counting the number of form fields returned with information

2002-04-18 Thread fliptop
[EMAIL PROTECTED] wrote: > On Wed, 17 Apr 2002 [EMAIL PROTECTED] wrote: > > sub missing_params { > foreach (keys %form_fields) { > next if defined param($_); > push @missing,$form_fields{$_}; > } > return scalar(@missing); > } what if a value is the null string? you need to ch

Re: Counting the number of form fields returned with information

2002-04-18 Thread eric-sourceforge
On Wed, 17 Apr 2002 [EMAIL PROTECTED] wrote: > What's the simplest way to make sure that all 10 fields have been > selected? I was hoping that... A slightly shorter, more elegant solution: #! /usr/bin/perl -w use CGI qw(:standard); use vars qw(%form_fields @missing); %form_fields = (

Re: Counting the number of form fields returned with information

2002-04-18 Thread eric-sourceforge
On Wed, 17 Apr 2002 [EMAIL PROTECTED] wrote: > What's the simplest way to make sure that all 10 fields have been > selected? This seems pretty straight-forward: param() returns a list of all form elements - even the form elements without values. To check that each field contains a value. #! /

Counting the number of form fields returned with information

2002-04-17 Thread eric-sourceforge
Hello, All: What's the simplest way to make sure that all 10 fields have been selected? I was hoping that... display_error_message() if param() < 10; would work, but it doesn't seem to work correctly. -- Eric P. Los Gatos, CA -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition