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

Error in Simple Tag lookup??

Quote Reply
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?

Code:
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.

HELP!!!!

Last edited by:

LanceWilson2: Sep 5, 2005, 2:03 PM
Subject Author Views Date
Thread Error in Simple Tag lookup?? LanceWilson2 8810 Sep 5, 2005, 2:01 PM
Thread Re: [LanceWilson2] Error in Simple Tag lookup??
604 8641 Sep 7, 2005, 10:04 AM
Thread Re: [TheStone] Error in Simple Tag lookup??
LanceWilson2 8645 Sep 7, 2005, 10:34 AM
Thread Re: [LanceWilson2] Error in Simple Tag lookup??
604 8645 Sep 7, 2005, 10:43 AM
Post Re: [TheStone] Error in Simple Tag lookup??
LanceWilson2 8674 Sep 7, 2005, 10:46 AM
Post Re: [TheStone] Error in Simple Tag lookup??
LanceWilson2 8632 Sep 8, 2005, 7:45 PM