jamaica
asked on
How to not print blank_fields?
I'm trying to set a command that will not print blank fields in my form's emailed results.
Let's say I have my check_email entries. If no value was entered for the field 'Version', I do not want to have the field 'Version' printed out in the email results.
How's the best way to have a no_blank_field_print set in the cgi script?
open CREATE_EMAIL, ">
print CREATE_EMAIL "\nVersion = $in{'Version'}";
print CREATE_EMAIL "\nType = $in{'Type'}\n";
close CREATE_EMAIL
Let's say I have my check_email entries. If no value was entered for the field 'Version', I do not want to have the field 'Version' printed out in the email results.
How's the best way to have a no_blank_field_print set in the cgi script?
open CREATE_EMAIL, ">
print CREATE_EMAIL "\nVersion = $in{'Version'}";
print CREATE_EMAIL "\nType = $in{'Type'}\n";
close CREATE_EMAIL
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would also point out on a related topic that it appears jamaica is using cgi-lib.
This library is old, outdated and not maintained.
Start using the standard CGI.pm module.
This library is old, outdated and not maintained.
Start using the standard CGI.pm module.
ASKER
Tintin, thank you!!
Yes, I'm using cgi-lib and will certainly look into upgrading to CGI.pm.
Yes, I'm using cgi-lib and will certainly look into upgrading to CGI.pm.
print CREATE_EMAIL "\nVersion = $in{'Version'}" if ($in{'Version'});
print CREATE_EMAIL "\nType = $in{'Type'}\n" if ($in{'Type'});