Gossamer Forum
Home : Products : DBMan : Installation :

Setting up checkbox fields, associating with select fields

(Page 2 of 2)
> >
Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
Way cool Smile I'll get back to work on it tomorrow. Thanks a lot.

KimL
Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
Not at all. Smile

Whatever is the easiest to implement!

Actually, I have a question...why do these following codes not work very well in my Employee Directory:

Code:
if ($rec{Personal} gt $db_default{'Personal'}) {
print qq| <TR><TD VALIGN="TOP" WIDTH="300" BGCOLOR="EEEEEE"><$font_color><B>Personal Homepage:</B></FONT></TD>
<TD WIDTH="300" BGCOLOR="FFFFFF"><$font><a href="$rec{'Personal'}">$rec{'Personal'}</a></Font></TD></TR>|;
}

if ($rec{AreaWeb} gt $db_default{'AreaWeb'}) {
print qq| <TR><TD VALIGN="TOP" WIDTH="300" BGCOLOR="EEEEEE"><$font_color><B>Academic Area/Department/Office<br> Home Page:</B></FONT></TD>
<TD WIDTH="300" BGCOLOR="FFFFFF"><$font><a href="$rec{'AreaWeb'}">$rec{'AreaWeb'}</a></Font></TD></TR>|;
}

It relates to this thread, because you showed Kim about printing certain fields. I have tried the above codes in a variety of formats, but what is printed is the "Description" column with a blank URL column if the record does not have a web page address.

I have my other fields formatted in the same way and they ONLY print out when there is text in the field.

(Sorry about the scrolling text...I tried my best to compact the text into one screen view.)

Hmm...Any thoughts? (Told you I might be back before the weekend. Smile)

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

[This message has been edited by Eliot (edited August 09, 1999).]

[This message has been edited by Eliot (edited August 09, 1999).]

[This message has been edited by Eliot (edited August 09, 1999).]
Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
Not a problem about the scrolling. I expect to have some from time to time.

Are you using

if ($rec{Personal} gt $db_default{'Personal'})

to get around the default "http://" that would be there if the user didn't enter anything? I know I said to do that before, but I'm not sure if it's such a good idea now. (I learn something new just about every day with this thing. Smile )

Since these are URLs, you might try

if ($rec{Personal} =~ /^http:\/\/.+\./)

That will check to be sure it's in the form of http://something-dot at the beginning. I checked it on my computer and it worked like it should. Whether it will work for you, though, I won't guarantee a thing! Smile


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





Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
Ah...That makes sense, Carol. Smile

There are no default values for any of the fields in this particular project, but having this field as a URL field will have to be configured differently. I'll give it a whirl tomorrow when I am back in the office.

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
Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
Okay, I'm still unsure about one thing: do I need to have a field in the database
definition for each practice, because they are checkboxes? Or can I just list them like
Eliot did in his employee directory, above?

Thanks,
KimL
Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
Kim,

Hi there. It is up to you. Using the Drop-Down Menu routine (build_fancy_select_fields) will only allow people to search for one Practice at a time.
If you use checkboxes, they can select multiple Practices for each search. In terms of space and also narrowing the search options for visitors, we are using the drop-down menus for the Academic Areas and Offices/Departments...but it is up to you.

Smile

JPDeni

The codes you provided worked like a charm. If there is no URL, then the row of the table does not print. Exactly what I was looking for.

Thanks.

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

[This message has been edited by Eliot (edited August 10, 1999).]
Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
Kim--

Yes. You need a field in your database for each checkbox.



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





Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
I'm ba-ack!

I've got most of the sub html_record_form working, but the code you gave me above doesn't work. Here's the code again:

Code:
|; # to close off any previous print qq| statement
foreach $practice (%prac_desc) {
<<line 358>> if ($rec{$practice}}) {
print qq|<tr><td>$rec{$practice}</td>
<td>$prac_desc{$practice}</td></tr>|;
}
}

I get this error:

Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: syntax error at ./html.pl line 358, near "}}"
syntax error at ./html.pl line 361, near "}"
(Might be a runaway multi-line &#0124; &#0124; string starting on line 359)

TIA for any help.

KimL
Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
Typo on my part. Sorry.

if ($rec{$practice}}) {

should be

if ($rec{$practice}) {

Also, there's another problem

foreach $practice (%prac_desc) {

should be

foreach $practice ( sort keys %prac_desc) {

Sorry 'bout that.



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





Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
No problem Smile Well, now the error message is gone, but nothing is printing out. This is the code I have now:

Code:
|; # to close off any previous print qq| statement
foreach $practice ( sort keys %prac_desc) {
if ($rec{$practice}) {
print qq|<tr><td>$rec{$practice}</td>
<td>$prac_desc{$practice}</td></tr>|;
}
}
print qq|
</TABLE>
|;
}

I have 30-some practice fields in the database definition, named practice01, practice02, etc. Are these
not getting picked up by $practice ? Or did I misunderstand something somewhere?

Thanks,
KimL

[This message has been edited by kiml (edited August 17, 1999).]
Quote Reply
Re: Setting up checkbox fields, associating with select fields In reply to
Could you start another thread with just the code that you have? I'm really confused. And this thread is much too long.


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





> >