I got this to work...However, I was wondering what the appropriate codes would be if there is NO email address.
Here is what I have working:
1) Set up a radio button field: Permission
(with Yes and No values)
2) Set up another field: Email (Not required)
3) Add the following code into the html_record_long sub-routine:
Code:
if ($rec{'Permission'} eq 'Yes') {
print qq|<$font><b>Email:</b> <a href="mailto:$rec{'Email'}">$rec{'Email'}</a></font><br>|;
}
else {
print qq|<$font><b>Email:</b> <a href="$db_script_link_url&$db_key=$rec{$db_key}&send_email_form=1">Send Message</a></font>|;
}
What codes do you insert if there is NO email address in the email address field? I know that the
send_email sub-routine checks the record and if there is no email address, then it returns an error message. But I was wondering if a third option can be added based on the Permission and Email fields.
The three options would be:
1) Print Email Address if there is an email address and if the user "checks" Yes.
2) Show Send Email Message Form if there is an email address and if the user "checks" No.
3) Shows nothing if there is no email address and if the Permission is set to No.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us