Mar 9, 2001, 11:51 AM
User (479 posts)
Mar 9, 2001, 11:51 AM
Post #28 of 95
Views: 11696
Addy,
this is not the only problem to customize linksql. I wait also for answer in another thread about "modifying select-field column". Creating, modifying and displaying select- and checkbox-fields is a MUST to customize linksql.
Itīs very quiet about this topics, so I have the feeling that you need to wait for further releases .....
Not pretty, but seems to be reality.
Michael
this is not the only problem to customize linksql. I wait also for answer in another thread about "modifying select-field column". Creating, modifying and displaying select- and checkbox-fields is a MUST to customize linksql.
Itīs very quiet about this topics, so I have the feeling that you need to wait for further releases .....
Not pretty, but seems to be reality.
Michael
Mar 9, 2001, 12:56 PM
Veteran (19537 posts)
Mar 9, 2001, 12:56 PM
Post #29 of 95
Views: 11815
Is there any reason why you posted the same post 4 times?
You can delete them by going to Edit > Delete
Paul Wilson.
Installations:
http://www.wiredon.net/gt/
You can delete them by going to Edit > Delete
Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Mar 9, 2001, 1:36 PM
Administrator (9387 posts)
Mar 9, 2001, 1:36 PM
Post #30 of 95
Views: 11889
Hi,
You could try:
my $html = $DB->html ( ['Users'], $IN );
return $html->select ( { name => 'Status', value => $IN->param('Status') });
}Cheers,
Alex
--
Gossamer Threads Inc.
You could try:
Code:
sub { my $html = $DB->html ( ['Users'], $IN );
return $html->select ( { name => 'Status', value => $IN->param('Status') });
}
Alex
--
Gossamer Threads Inc.
Mar 11, 2001, 11:45 AM
User (479 posts)
Mar 11, 2001, 11:45 AM
Post #32 of 95
Views: 11648
Hi Alex,
I used your code and it works fine for select-fields, and I tried to use the code also for checkbox-fields in this way
sub {
my $html = $DB->html ( ['Users'], $IN );
return $html->checkbox ( { name => 'Status', value => $IN->param('Status') });}
The checkboxes where displayed fine at the add-form, but only the first selected checkbox-field will be saved.
Any ideas?
Michael
I used your code and it works fine for select-fields, and I tried to use the code also for checkbox-fields in this way
sub {
my $html = $DB->html ( ['Users'], $IN );
return $html->checkbox ( { name => 'Status', value => $IN->param('Status') });}
The checkboxes where displayed fine at the add-form, but only the first selected checkbox-field will be saved.
Any ideas?
Michael
Sep 3, 2001, 8:10 PM
Veteran (1345 posts)
Sep 3, 2001, 8:10 PM
Post #33 of 95
Views: 11738
Hi All
What I am interested in is generating a select box with the values allowed in a specific field for a specific record - all within link.html and detail.html - as with a web store catalog.
The link.html would be the specific product with its specific options (generated from its values in the fields), and the detail.html would have the same specific options with a larger image, etc.
So, for example, if you had a field called SIZE, and you had 500 records of, say, shoes and shirts, each with it's own range of values in the SIZE field, I want to build a select box for each link in link.html and detail.html containing just the values for each record. If there are no values in the Size field, a select box is not built.
Is this specifically what Alex's code will do, or does Alex's code snag all values up and down that entire column of values and build one big giant list of all values within the db for the Size field?
What I'm trying to do is use the script as a web store catalog, and being able to build select boxes for Item Options like Size by using just the values in the Size field for each ID is an important feature.
I hope that I have explained this well enough.
Thanks very much for your help.
DT
What I am interested in is generating a select box with the values allowed in a specific field for a specific record - all within link.html and detail.html - as with a web store catalog.
The link.html would be the specific product with its specific options (generated from its values in the fields), and the detail.html would have the same specific options with a larger image, etc.
So, for example, if you had a field called SIZE, and you had 500 records of, say, shoes and shirts, each with it's own range of values in the SIZE field, I want to build a select box for each link in link.html and detail.html containing just the values for each record. If there are no values in the Size field, a select box is not built.
Is this specifically what Alex's code will do, or does Alex's code snag all values up and down that entire column of values and build one big giant list of all values within the db for the Size field?
What I'm trying to do is use the script as a web store catalog, and being able to build select boxes for Item Options like Size by using just the values in the Size field for each ID is an important feature.
I hope that I have explained this well enough.
Thanks very much for your help.

DT
Sep 4, 2001, 1:02 PM
Administrator (9387 posts)
Sep 4, 2001, 1:02 PM
Post #34 of 95
Views: 11717
Hi,
Probably best to use a bit of code to do this. I'm not 100% sure what you want to do, but this might help:
size_select_list =>
my $tags = shift;
my @allowed_sizes = split /\s+/, $tags->{Allowed_Sizes};
my $selected = $IN->param('Size');
my $output = '<select name="Size">';
foreach my $size (@allowed_sizes) {
if ($selected eq $size) {
$output .= "<option selected>$size";
}
else {
$output .= "<option>$size";
}
}
$output .= "</select>";
return $output;
}To use that, you would add a column called Allowed_Sizes that would contain a space separated list of sizes that apply to this item. Then you would simply put:
<%size_select_list%>
to generate the select list.
Cheers,
Alex
--
Gossamer Threads Inc.
Probably best to use a bit of code to do this. I'm not 100% sure what you want to do, but this might help:
size_select_list =>
Code:
sub { my $tags = shift;
my @allowed_sizes = split /\s+/, $tags->{Allowed_Sizes};
my $selected = $IN->param('Size');
my $output = '<select name="Size">';
foreach my $size (@allowed_sizes) {
if ($selected eq $size) {
$output .= "<option selected>$size";
}
else {
$output .= "<option>$size";
}
}
$output .= "</select>";
return $output;
}
<%size_select_list%>
to generate the select list.
Cheers,
Alex
--
Gossamer Threads Inc.
Sep 5, 2001, 10:19 AM
Veteran (1345 posts)
Sep 5, 2001, 10:19 AM
Post #35 of 95
Views: 11791
Thank you so much, Alex.
What I'm trying to do is set up a web store that can handle all kinds of pricing options (volume discounts and the like), item options (including options that adjust the price), shipping options, etc. - very flexible.
All these pricing and other options would be included in the database, and the output pages would be automatically built to work with my shopping cart.
This requires the ability to easily create and manage multiple select boxes, checkboxes, and radio buttons, as well as lots of hidden stuff.
To offer options that adjust the price, while still building the select boxes, some additional code has to be added to each option, and I'm concerned that the extra symbols might mess up the build process. For example, if I want to offer size options, and the 2XL and larger sizes involve an additional charge, the select options should look like this:
Small
Medium
Large
X-Large
XXL!+1.50
XXXL!+2.00
and the field value would look like this, given your code above using a space as a delimiter within the size field:
Will the extra ! and + symbols mess up the building process?
Also, another thing that I want to do is offer volume discount pricing. This involves a string of pipe-delimited options for the cart to recognize the volume discount pricing scheme and also the use, again, of the ! symbol.
For example, the format that my shopping cart uses for volume discount pricing looks like the following:
I would have to include the full string of:
in the "Price" field of X product, but my concern is that the pipes and the exclamation points will mess up the build process.
Should the cart's required pipes delimiters and exclamation points be escaped somehow so that the build process is unaffected, while safeguarding the integrity of the data that is to be transferred from the db to the output pages? Perhaps the quantity discount line and the size line should be enclosed in quotes.
Thank you so much, again. I really appreciate your help.
DT

What I'm trying to do is set up a web store that can handle all kinds of pricing options (volume discounts and the like), item options (including options that adjust the price), shipping options, etc. - very flexible.
All these pricing and other options would be included in the database, and the output pages would be automatically built to work with my shopping cart.
This requires the ability to easily create and manage multiple select boxes, checkboxes, and radio buttons, as well as lots of hidden stuff.
To offer options that adjust the price, while still building the select boxes, some additional code has to be added to each option, and I'm concerned that the extra symbols might mess up the build process. For example, if I want to offer size options, and the 2XL and larger sizes involve an additional charge, the select options should look like this:
Small
Medium
Large
X-Large
XXL!+1.50
XXXL!+2.00
and the field value would look like this, given your code above using a space as a delimiter within the size field:
Will the extra ! and + symbols mess up the building process?
Also, another thing that I want to do is offer volume discount pricing. This involves a string of pipe-delimited options for the cart to recognize the volume discount pricing scheme and also the use, again, of the ! symbol.
For example, the format that my shopping cart uses for volume discount pricing looks like the following:
I would have to include the full string of:
in the "Price" field of X product, but my concern is that the pipes and the exclamation points will mess up the build process.
Should the cart's required pipes delimiters and exclamation points be escaped somehow so that the build process is unaffected, while safeguarding the integrity of the data that is to be transferred from the db to the output pages? Perhaps the quantity discount line and the size line should be enclosed in quotes.
Thank you so much, again. I really appreciate your help.


DT
Sep 5, 2001, 11:42 AM
Administrator (9387 posts)
Sep 5, 2001, 11:42 AM
Post #36 of 95
Views: 11516
As for the discounts, same answer. The build won't care about what's in the data.
Cheers,
Alex
--
Gossamer Threads Inc.
Nov 18, 2001, 5:14 AM
Veteran (1345 posts)
Nov 18, 2001, 5:14 AM
Post #37 of 95
Views: 11507
Hi Alex
This has worked great for select boxes. Bulls-eye!
What I am now trying to do is use something similar for creating checkboxes and radio buttons, where there are already values in a link field like Allowed_Sizes.
For example, there might be Allowed_Colors, etc.
I have been hacking away with the size_select_list stuff to build checkboxes and radio buttons, but I keep getting errors.
Here is what I'm trying for radio buttons:
my $tags = shift;
my @allowed_sizes = split /\s+/, $tags->{Allowed_Sizes};
my $selected = $IN->param('Size');
foreach my $size (@allowed_sizes) {
if ($selected eq $size) {
$output .= "<input type=radio name=Size value=$size checked> $size";
}
else {
$output .= "<input type=radio name=Size value=$size> $size";
}
}
return $output;
}
And, here is the current error message that I'm getting:
Unable to compile 'size_radio_list'. Reason: Global symbol "$output" requires explicit package name at (eval 21) line 7.
Global symbol "$output" requires explicit package name at (eval 21) line 10.
Global symbol "$output" requires explicit package name at (eval 21) line 13.
How would I adjust things to be able to create checkboxes and radio buttons?
Many thanks, again, for your help.
DogTags
------------------------------------------
This has worked great for select boxes. Bulls-eye!
What I am now trying to do is use something similar for creating checkboxes and radio buttons, where there are already values in a link field like Allowed_Sizes.
For example, there might be Allowed_Colors, etc.
I have been hacking away with the size_select_list stuff to build checkboxes and radio buttons, but I keep getting errors.
Here is what I'm trying for radio buttons:
Code:
sub { my $tags = shift;
my @allowed_sizes = split /\s+/, $tags->{Allowed_Sizes};
my $selected = $IN->param('Size');
foreach my $size (@allowed_sizes) {
if ($selected eq $size) {
$output .= "<input type=radio name=Size value=$size checked> $size";
}
else {
$output .= "<input type=radio name=Size value=$size> $size";
}
}
return $output;
}
And, here is the current error message that I'm getting:
Quote:
A fatal error has occured: Unable to compile 'size_radio_list'. Reason: Global symbol "$output" requires explicit package name at (eval 21) line 7.
Global symbol "$output" requires explicit package name at (eval 21) line 10.
Global symbol "$output" requires explicit package name at (eval 21) line 13.
How would I adjust things to be able to create checkboxes and radio buttons?
Many thanks, again, for your help.

DogTags
------------------------------------------
Nov 27, 2001, 11:02 PM
Staff (4101 posts)
Nov 27, 2001, 11:02 PM
Post #39 of 95
Views: 11599
Quote:
A fatal error has occured: Unable to compile 'size_radio_list'. Reason: Global symbol "$output" requires explicit package name at (eval 21) line 7.
Global symbol "$output" requires explicit package name at (eval 21) line 10.
Global symbol "$output" requires explicit package name at (eval 21) line 13.
my $output;
above the foreach loop.
Adrian
Jan 10, 2002, 1:31 PM
User (479 posts)
Jan 10, 2002, 1:31 PM
Post #43 of 95
Views: 11328
Linksl 2.10
I wanted to use a custom-select-field at include_form.html and tried to use your code without success
size_select_list =>
my $tags = shift;
my @allowed_sizes = split /\s+/, $tags->{Allowed_Sizes};
my $selected = $IN->param('Size');
my $output = '<select name="Size">';
foreach my $size (@allowed_sizes) {
if ($selected eq $size) {
$output .= "<option selected>$size";
}
else {
$output .= "<option>$size";
}
}
$output .= "</select>";
return $output;
}
--
Michael Skaide
http://www.cycle24.de
I wanted to use a custom-select-field at include_form.html and tried to use your code without success
size_select_list =>
Code:
sub { my $tags = shift;
my @allowed_sizes = split /\s+/, $tags->{Allowed_Sizes};
my $selected = $IN->param('Size');
my $output = '<select name="Size">';
foreach my $size (@allowed_sizes) {
if ($selected eq $size) {
$output .= "<option selected>$size";
}
else {
$output .= "<option>$size";
}
}
$output .= "</select>";
return $output;
}
--
Michael Skaide
http://www.cycle24.de
Jul 11, 2002, 4:12 PM
Staff (429 posts)
Jul 11, 2002, 4:12 PM
Post #45 of 95
Views: 11322
Hi There,
Not sure if this helps you too much, but this will allow you to autopopulate your form inputs.
Upload this file into your ../admin/ directory, yup the same directory as admin.cgi, and you will be able to do the following.
For text boxes
If you have something like ?....&textbox1=foobarbaz or a keyname in the tags for GT::Template it will create the appropriate HTML for a form textbox.
As well, if you add additional parameters as following:
It will add the size=12 attribute to the input tag. You can also force the value of the textbox by just adding a .... value => 'sometext'
Please note that support for radioboxes and checkboxes are a little bit iffy, the following code
Will create the checkbox, but only if you have ...&checkbox1=bar... will it be checked. (makes sense why, I hope
)
Take a look inside the module for what other form tags it supports.
Let me know if you have any problems.
Please note that if anyone wants to use this in their Links SQL plugin, please rename the package into your own namespace, store it in another location and use that version.... as the interface may yet change. (This is just a personnal module that I'm making public that may be of use to others)
Not sure if this helps you too much, but this will allow you to autopopulate your form inputs.
Upload this file into your ../admin/ directory, yup the same directory as admin.cgi, and you will be able to do the following.
For text boxes
Code:
<%HTML::text( 'name' => 'textbox1' )%>If you have something like ?....&textbox1=foobarbaz or a keyname in the tags for GT::Template it will create the appropriate HTML for a form textbox.
As well, if you add additional parameters as following:
Code:
<%HTML::text( 'name' => 'textbox1', 'size' => 12 )%>It will add the size=12 attribute to the input tag. You can also force the value of the textbox by just adding a .... value => 'sometext'
Please note that support for radioboxes and checkboxes are a little bit iffy, the following code
Code:
<%HTML::checkbox( 'name' => 'checkbox1', 'value' => 'bar' )%>Will create the checkbox, but only if you have ...&checkbox1=bar... will it be checked. (makes sense why, I hope

Take a look inside the module for what other form tags it supports.
Let me know if you have any problems.
Please note that if anyone wants to use this in their Links SQL plugin, please rename the package into your own namespace, store it in another location and use that version.... as the interface may yet change. (This is just a personnal module that I'm making public that may be of use to others)
Jul 12, 2002, 7:56 AM
Veteran (1345 posts)
Jul 12, 2002, 7:56 AM
Post #46 of 95
Views: 11356
Hey, thanks, Aki !
This looks really interesting. You've got a lot of form stuff in HTML.pm
I'm having a problem uploading the script into /admin, though. I've tried to FTP your file into the /admin directory, but I'm getting denied - 550
I can upload stuff to the /templates directory, and even rename, etc., but for some reason, files at the /admin level seem to have other restrictions, but I can't seem to identify anything different.
Would you have any suggestions??
Many thanks for your help.
------------------------------------------
This looks really interesting. You've got a lot of form stuff in HTML.pm
I'm having a problem uploading the script into /admin, though. I've tried to FTP your file into the /admin directory, but I'm getting denied - 550
I can upload stuff to the /templates directory, and even rename, etc., but for some reason, files at the /admin level seem to have other restrictions, but I can't seem to identify anything different.
Would you have any suggestions??
Many thanks for your help.

------------------------------------------