Gossamer Forum
Home : Products : DBMan : Customization :

when a user leaves a field empty, is it possible to auto fill in a space

Quote Reply
when a user leaves a field empty, is it possible to auto fill in a space
When a user leaves a field empty, it looks awfull when you are viewing it. Is it possible to fill in a space when a user leave a field empty so it doesnt look diffent from the other field with an entry.


thanks,
martijn
sorry for my poor english, I am from the netherlands.
Quote Reply
Re: when a user leaves a field empty, is it possible to auto fill in a space In reply to
The best thing to do is use conditional if and else statements, like the following (and which has been mentioned before in this Forum).....

Code:
if ($rec{'FieldName'}) {
print qq| $rec{'FieldName'}|;
}
else {
print qq| |;
}

Change FieldName to the name of your fields.

Adding a default value of a space in your database definition section of your default.cfg file, will make the fields with text look bad.

But using this type of conditional statement will put a space if nothing is added in the field.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------







Quote Reply
Re: when a user leaves a field empty, is it possible to auto fill in a space In reply to
hi Eliot,

I coming there. I looked for something like the fill in a space and found some threads but didnot think the where appropriate..

Where do i have to place this conditional statements ? and if I have more fields, do I have just make a few of them or is there an "and" statement for ?

thanx
martijn
Quote Reply
Re: when a user leaves a field empty, is it possible to auto fill in a space In reply to
Uh...this goes in your sub html_record routing in your html.pl!

NO, you do not add extra fields. Just replace FieldName with the name of your fields!

Got it? I hope so!

Smile

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------