Gossamer Forum
Home : Products : DBMan : Customization :

Column Display Hack: Base # of columns on form input?

Quote Reply
Column Display Hack: Base # of columns on form input?
I've successfully implemented the column display hack but now I am trying to do something a bit different. Instead of hard-coding the number of columns into html.pl, I would like the $cols= value to be based on incoming form data.

Here's what I have now:

$i = 1;
$cols = 3; # Change this to the number of columns you want


Here's what I changed it to and got an error:

$i = 1;
$cols = $form_data{'colnum'}; # Change this to the number of columns you want

Something tells me it's real simple but for some reason I can't seem to get anything other than a hardcoded value to work.

Last edited by:

idg-usa: Sep 25, 2003, 8:21 PM
Quote Reply
Re: [idg-usa] Column Display Hack: Base # of columns on form input? In reply to
Forget it. I figured it out. If someone in reads this and wants to know how I did it, just post.
Quote Reply
Re: [idg-usa] Column Display Hack: Base # of columns on form input? In reply to
i'm interested in seeing what you did. what i've been thinking about is a form similar to search form where user chooses the columns/fields he wants to see on report. that way each user could produce a nice customized display.
Quote Reply
Re: [delicia] Column Display Hack: Base # of columns on form input? In reply to
Ok here's what you need to do:

In the section beginning at line 361 in db.cgi add this line:

$in{'colnum'} ? ($cols = $in{'colnum'}) : ($cols);

In html.pl where you have $cols = 3 remove everything so that you just have the $cols variable.

In the form that the user will select the number columns, the field sending the value should be named 'colnum'.

Let me know if you have any questions.