Gossamer Forum
Home : Products : DBMan : Installation :

Checkbox problem...

Quote Reply
Checkbox problem...
Hi folks,

I have a field that is admin/modify only and is a checkbox. When we modify the field by checking one of the three checkboxes, the next time you call up that record, the checkboxes are empty. Anyone have any idea as to why it will not keep the selection previously made?
Quote Reply
Re: Checkbox problem... In reply to
I'm assuming that, if you have admin-only fields, you're using a "if ($per_admin) {" type command.

Be sure that before your "if" statement, you close off the previous print statement with a |; and that after the "if" statement you start up with a print qq|.

That's usually the cause of my problems. Also forgetting to add a ; at the end of commands.

When you look at the error message, be aware that the problem will probably not be on the line number it gives you. Start there and work your way up. (A real bummer when it's the last line of the script!)



------------------
JPD
Quote Reply
Re: Checkbox problem... In reply to
hi JPD...

Here is the code from the html.pl for the sub html_record_form:

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Warnings:</FONT></TD>
<TD VALIGN="TOP"> |; print &build_checkbox_field ("Warnings", "$rec{'Warning'}"); print qq|</TD></TR>

And here is the code for the sub html_record:

<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Warnings:</FONT></TD>
<TD> <$font>$rec{'Warnings'}</Font></TD></TR>


The boxes show up... and if you modify them, when you view the record, the modification shows up. However, if you select Modify again, the info is gone...


Any light you can shed would be greatly appreciated.

Thanks! =)
Ziggy
Quote Reply
Re: Checkbox problem... In reply to
Hi Ziggy

you have $rec{'Warning'} in one place and $rec{'Warnings'} in the other. It should be the one you have defined in your .cfg

cheers
-JO
Quote Reply
Re: Checkbox problem... In reply to
Hi Jamie...

yeah... I noticed that when I was rereading the message after I posted it. Added the s to the one area and volia! it worked.

Now I have a cosmetic question of sorts.

I have the areas that are per_admin/modify only. At the moment, they appear at the top of the form when accessed for modifications and views. I think that it would be better to have them at the bottom of the form. So I tried to cut and paste them to the bottom of the field, but keep getting cgi errors in the ./html.pl regarding the code.

I am at work at the moment so I don't have access to the error info (I changed things back before coming in this morning). But I will post the error message when I get home.
Quote Reply
Re: Checkbox problem... In reply to
Are you using &build_checkbox_field to make the checkbox?



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