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
Aug 15, 1999, 8:56 PM
Veteran / Moderator (8669 posts)
Aug 15, 1999, 8:56 PM
Post #2 of 3
Views: 1304
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:
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
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
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