Home : Products : DBMan SQL : Development, Plugins and Globals :

Products: DBMan SQL: Development, Plugins and Globals: Error in Simple Tag lookup??: Edit Log

Here is the list of edits for this post
Error in Simple Tag lookup??
I have a global that quite simply sees what type of a doctor the logged in user is and depending on that information it creates a drop down list from a column of choices from a table (in this case it displays Insurance Carrier types). But it recently started giving me errors. Was wondering if somebody else could look at it and tell me what is wrong with the code?

The problem I have traced back to the "DrType" field. While I can manually place a DrType value in like:
" my $DrType = "Podiatry"; " and it works perfectly; when I put in the " my $DrType = $tags->{DrType}; " it doesn't seem to load the DrType value at all. But here is the weird part, when I use the <%DrType%> field in the template it displays correctly as the doctor type. Could something be wrong with my CGI code or how I am referencing that variable?

sub {
# Display the Carriers select list.
my $tags = GT::Template->tags;
my $table = $DB->table('Select_Entries');
my $sth = ""; my $key = "";
my $DrType = $tags->{DrType};if ($DrType eq "PTherapy") {
$sth = $table->select (['PTCarriers']);
$key = "PTCarriers";
elsif ($DrType eq "Acu") {
$sth = $table->select (['AcuCarriers']);
$key = "AcuCarriers";
elsif ($DrType eq "Podiatry") {
$sth = $table->select (['PodCarriers']);
$key = "PodCarriers";
else {
$sth = $table->select (['Carriers']);
$key = "Carriers";
}my $output = "<select name=\"Carrier\" id=\"Carrier\" size=\"1\">";
$output .= " <option value=\"\" SELECTED>-- Select One (".$DrType.") --</option>";
while (my $row = $sth->fetchrow_hashref) {
$row->{$key} =~ s/\s+$//;
if($row->{$key} ne ''){
$output .= "<option value=\"".$row->{$key}."\">".$row->{$key}."</option>";
} $output .= "</select>";
return $output;

This is the output that I get when it is displayed in the form: -- Select One (SCALER(0xa39368c)) --
with all of the "default" [Carriers] carriers list. It should say: -- Select One (Podiatry) -- or something like that.


Last edited by:

LanceWilson2: Sep 5, 2005, 2:03 PM

Edit Log: