Gossamer Forum
Home : Products : DBMan : Customization :

Hide http field help

Quote Reply
Hide http field help
If the user does not enter a website (but leaves the default text - http:// - in the text box) i want to hide the output. I think I have seen a mod or edit for this but cannot find it again. Thanks for the direction if anyone can point me the right way
Quote Reply
Re: Hide http field help In reply to
One thing that you can do is remove the http:// if the user doesn't enter a URL. Go to http://www.jpdeni.com/dbman/Mods/changes.txt and add the replacement for sub parse_form.

In sub html_record, you would normally have something like this:

Code:
print qq|
other fields that are being printed
<tr><td>Website</td>
<td><a href="$rec{'URL'}">$rec{'URL'}</td></tr>
other fields that are being printed
|;

Your fieldname may not be URL, so you would change the name to match your database.

To make the field only print out when a URL has been added, use

Code:
print qq|
other fields that are being printed
|;
if ($rec{'URL'}) {
print qq|
<tr><td>Website</td>
<td><a href="$rec{'URL'}">$rec{'URL'}</td></tr>
|;
}
print qq|
other fields that are being printed
|;

Make sense?

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





Quote Reply
Re: Hide http field help In reply to
Perfect - works like a charm!