I using Perl cgi for my web site and can't seem to format the SELECT tag when using 3 columns of data (userid, full username, and phone number). I've tried PACK statements, tabs, etc with no luck. Will consider using a javascript if necessary. I've spent a lot of time on this and is used throughout my web....any help would be appreciated.
Mar 23, 2005, 12:21 AM
Veteran (2312 posts)
Mar 23, 2005, 12:21 AM
Post #2 of 7
Views: 8094
You should describe in more details what you want.
If I understand correctly, multiple columns is not possible SELECT tag, but I may misunderstand the problem.
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
If I understand correctly, multiple columns is not possible SELECT tag, but I may misunderstand the problem.
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Mar 23, 2005, 3:25 PM
Novice (5 posts)
Mar 23, 2005, 3:25 PM
Post #3 of 7
Views: 8085
I'm sorry, I thought I was specific....but I think you answered my question. I have three separate columns that shows up in the SELECT tag box -- all of which are variable lengths. I was trying to format so the first column with the userid's displayed were always 16 characters, the second "column" always 25 characters, etc. I tried using the PACK statement to pad spaces and tried to insert a \t (tab), I even tried to pad with &NBSP for USERID'S less than 16 characters in length -- none of the format attempts were recognized and the &NBSP doesn't work in the way I was trying to use it. Each line of the SELECT would contain USERID FULLNAME PHONE. I would consider a javascript that would allow me to just have the userid in the SELECT box, but would display the full user name on MOUSEOVER. I just haven't been able to make this happen....and would really appreciate help.
Mar 24, 2005, 5:55 AM
Veteran (2312 posts)
Mar 24, 2005, 5:55 AM
Post #4 of 7
Views: 8075
You should try to show examples.
That's too complicated described this way...
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
That's too complicated described this way...
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Mar 24, 2005, 4:35 PM
Novice (5 posts)
Mar 24, 2005, 4:35 PM
Post #5 of 7
Views: 8061
Okay....examples. Below are two examples of trying to format the line within a SELECT box :
Sample Line Output: maryjane Mary Jane LaRiviere 206.304.4464
rocky1009 Rocky Mayberry 206.304.4464
Desired Output: maryjane Mary Jane LaRiviere 206.304.4464
rocky1009 Rocky Mayberry 206.304.4464
One:
print qq(<select name="chgusr" size=15>);
my $cnt=1;
while ($cnt <= $lcnt ){
$lnr=substr($newdata,$sbyte,16);$sbyte+=16;
$lnm=substr($newdata,$sbyte,40);$sbyte+=40;
$lph=substr($newdata,$sbyte,24);$sbyte+=24;
print qq(<option value=$lnr>$lnr\ \ \ \ \ \ \ \ \ $lnm\ \ \ \ \ \ \ \ \ $lph \n);
$cnt++;
}
print qq(</select>);
Two:
print qq(<select name="chgusr" size=15>);
my $cnt=1;
while ($cnt <= $lcnt ){
$lnr=substr($newdata,$sbyte,16);$sbyte+=16;
$lnm=substr($newdata,$sbyte,40);$sbyte+=40;
$lph=substr($newdata,$sbyte,24);$sbyte+=24;
$fcnt=length($lnr);
$outfmt=$lnr;
while ($fcnt <= 16){
$outfmt=($outfmt."\ ");
$fcnt++;
}
print qq(<option value=$lnr>$lnr $outfmt $lnm\n);
$cnt++;
}
print qq(</select>);
If there is some kind of javascript that could allow me to just have the "$lnr" in the SELECT box and expand the "$lnm" on MOUSEOVER via javascript or whatever...that would work fine. Right now I use this throughout my program....whether it is userids, groups, addresses, etc.
Thanks for your help webmaster33.
Sample Line Output: maryjane Mary Jane LaRiviere 206.304.4464
rocky1009 Rocky Mayberry 206.304.4464
Desired Output: maryjane Mary Jane LaRiviere 206.304.4464
rocky1009 Rocky Mayberry 206.304.4464
One:
print qq(<select name="chgusr" size=15>);
my $cnt=1;
while ($cnt <= $lcnt ){
$lnr=substr($newdata,$sbyte,16);$sbyte+=16;
$lnm=substr($newdata,$sbyte,40);$sbyte+=40;
$lph=substr($newdata,$sbyte,24);$sbyte+=24;
print qq(<option value=$lnr>$lnr\ \ \ \ \ \ \ \ \ $lnm\ \ \ \ \ \ \ \ \ $lph \n);
$cnt++;
}
print qq(</select>);
Two:
print qq(<select name="chgusr" size=15>);
my $cnt=1;
while ($cnt <= $lcnt ){
$lnr=substr($newdata,$sbyte,16);$sbyte+=16;
$lnm=substr($newdata,$sbyte,40);$sbyte+=40;
$lph=substr($newdata,$sbyte,24);$sbyte+=24;
$fcnt=length($lnr);
$outfmt=$lnr;
while ($fcnt <= 16){
$outfmt=($outfmt."\ ");
$fcnt++;
}
print qq(<option value=$lnr>$lnr $outfmt $lnm\n);
$cnt++;
}
print qq(</select>);
If there is some kind of javascript that could allow me to just have the "$lnr" in the SELECT box and expand the "$lnm" on MOUSEOVER via javascript or whatever...that would work fine. Right now I use this throughout my program....whether it is userids, groups, addresses, etc.
Thanks for your help webmaster33.
Mar 24, 2005, 4:40 PM
Novice (5 posts)
Mar 24, 2005, 4:40 PM
Post #6 of 7
Views: 8041
Second attempt since the below sample Outputs didn't stay formatted.
Okay....examples. Below are two examples of trying to format the line within a SELECT box :
Sample Line Output (the three fields should line up ...userid fullname phone):
maryjane Mary Jane LaRiviere 206.304.4464
rocky1009 Rocky Mayberry 206.304.4464
Example One:
print qq(<select name="chgusr" size=15>);
my $cnt=1;
while ($cnt <= $lcnt ){
$lnr=substr($newdata,$sbyte,16);$sbyte+=16;
$lnm=substr($newdata,$sbyte,40);$sbyte+=40;
$lph=substr($newdata,$sbyte,24);$sbyte+=24;
print qq(<option value=$lnr>$lnr\ \ \ \ \ \ \ \ \ $lnm\ \ \ \ \ \ \ \ \ $lph \n);
$cnt++;
}
print qq(</select>);
Example Two:
print qq(<select name="chgusr" size=15>);
my $cnt=1;
while ($cnt <= $lcnt ){
$lnr=substr($newdata,$sbyte,16);$sbyte+=16;
$lnm=substr($newdata,$sbyte,40);$sbyte+=40;
$lph=substr($newdata,$sbyte,24);$sbyte+=24;
$fcnt=length($lnr);
$outfmt=$lnr;
while ($fcnt <= 16){
$outfmt=($outfmt."\ ");
$fcnt++;
}
print qq(<option value=$lnr>$lnr $outfmt $lnm\n);
$cnt++;
}
print qq(</select>);
If there is some kind of javascript that could allow me to just have the "$lnr" in the SELECT box and expand the "$lnm" on MOUSEOVER via javascript or whatever...that would work fine. Right now I use this throughout my program....whether it is userids, groups, addresses, etc.
Thanks for your help webmaster33.
Okay....examples. Below are two examples of trying to format the line within a SELECT box :
Sample Line Output (the three fields should line up ...userid fullname phone):
maryjane Mary Jane LaRiviere 206.304.4464
rocky1009 Rocky Mayberry 206.304.4464
Example One:
print qq(<select name="chgusr" size=15>);
my $cnt=1;
while ($cnt <= $lcnt ){
$lnr=substr($newdata,$sbyte,16);$sbyte+=16;
$lnm=substr($newdata,$sbyte,40);$sbyte+=40;
$lph=substr($newdata,$sbyte,24);$sbyte+=24;
print qq(<option value=$lnr>$lnr\ \ \ \ \ \ \ \ \ $lnm\ \ \ \ \ \ \ \ \ $lph \n);
$cnt++;
}
print qq(</select>);
Example Two:
print qq(<select name="chgusr" size=15>);
my $cnt=1;
while ($cnt <= $lcnt ){
$lnr=substr($newdata,$sbyte,16);$sbyte+=16;
$lnm=substr($newdata,$sbyte,40);$sbyte+=40;
$lph=substr($newdata,$sbyte,24);$sbyte+=24;
$fcnt=length($lnr);
$outfmt=$lnr;
while ($fcnt <= 16){
$outfmt=($outfmt."\ ");
$fcnt++;
}
print qq(<option value=$lnr>$lnr $outfmt $lnm\n);
$cnt++;
}
print qq(</select>);
If there is some kind of javascript that could allow me to just have the "$lnr" in the SELECT box and expand the "$lnm" on MOUSEOVER via javascript or whatever...that would work fine. Right now I use this throughout my program....whether it is userids, groups, addresses, etc.
Thanks for your help webmaster33.
Mar 25, 2005, 7:12 AM
Veteran (2312 posts)
Mar 25, 2005, 7:12 AM
Post #7 of 7
Views: 8059
I think I got it, what you want.
But as far as I can remember, your current solution, is the only possible solution (to format using spaces).
Also you might want to read about Perl's format function:
http://perldoc.com/...pod/func/format.html
http://perldoc.com/....4/pod/perlform.html
You might also want to check CSS, to see if there is any helpful feature. I'm not CSS expert, but others may help you.
That's all I can suggest.
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
But as far as I can remember, your current solution, is the only possible solution (to format using spaces).
Also you might want to read about Perl's format function:
http://perldoc.com/...pod/func/format.html
http://perldoc.com/....4/pod/perlform.html
You might also want to check CSS, to see if there is any helpful feature. I'm not CSS expert, but others may help you.
That's all I can suggest.
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...