Gossamer Forum
Home : Products : DBMan : Installation :

Not displaying a field if it is empty.

Quote Reply
Not displaying a field if it is empty.
If someone leaves a field blank, is there a way to not display it ?
Quote Reply
Re: Not displaying a field if it is empty. In reply to
I have done it like this:

|;

if ($rec{'Whatever_Field'} ne "") {print qq|

$rec{'Whatever_Field'}

|;}

print qq|
Quote Reply
Re: Not displaying a field if it is empty. In reply to
There's plenty of ways to write the same thing in Perl, but I prefer the "positive" approach:

if ($rec{'FieldName'}) {
print qq|whatever|;
}



------------------
JPD
Quote Reply
Re: Not displaying a field if it is empty. In reply to
Ok JDP
Once again Where should i put above lines
Quote Reply
Re: Not displaying a field if it is empty. In reply to
This is in html_record, which is where you are printing out the display of the record information.

Be sure to start with a

|;

to close off the previous print qq| statement and end with a

print qq|

to continue printing the display of information.


------------------
JPD





Quote Reply
Re: Not displaying a field if it is empty. In reply to
Ok.JPD
I did as you said but it does not work
I did couple changes to view
so the "company" field is (if link exist)underline (http://)link but it doesn't
work and if there is no link by pointing at
database you'l see http:///
meaning that link exist
the file is at
http://www.ict2000.com/html.txt

Quote Reply
Re: Not displaying a field if it is empty. In reply to
Try looking at the response I wrote today at http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000230.html

I thought of a new way to check the field and there is a very complete tutorial on how to set it up. If you have more questions on it, answer on that thread, please, so they're all together.


------------------
JPD