Forum Moderators: coopster & phranque

Message Too Old, No Replies

Validating cgi field entry

triggering validation upon selection of field value

         

Orsen_Cart

9:48 pm on Oct 29, 2004 (gmt 0)

10+ Year Member



Hi

I have a cgi script which produces three fields and an image buttion in my html page.

The each field is produced like ....

print "\n\nYour Interest:<br>\n";
print $query->popup_menu(
-name=>'Interest',
-values=>['','A','B','C','D','E','F','G','H'],
-default=>'Please Select',
-labels=>\%labels);

and the image button is...

print "\n\n";
print $query->image_button(
-name=>'paypal',
-src=>'https://www.paypal.com/en_US/i/btn/x-click-butcc.gif',
-align=>'LEFT');

I want to trigger validation of the users action when a value is selected or the button is clicked. Then validation I am using is like .....

if($int eq "")
{
print "Please select your interest";
}
else
{
if($loc eq "")
{
print "Please select your area";
....

etc, etc.

The validation works ok but I can't find out how to get the validation to 'fire' at the correct time. This is a doddle in javascript :-)

Can anyone help?

Many thanks

DrDoc

7:41 pm on Nov 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's not possible since it would require submitting the form all the time... and you don't want to do that (seriously).

Use JavaScript for that type of client side validation. Then validate the entire form upon submission.