Gossamer Forum
Home : Products : DBMan : Customization :

Add a different select field to 2 users

Quote Reply
Add a different select field to 2 users
Hi if some one could help me please!!!!!!!!

in the html.pl in sub html_record

after
----
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);

print qq|
<table border=0>
<tr>
<td valign="top">

---
Im trying to add this
----


|;

$in{$db_cols[$Gen]} = N;
my ($status,@hits) = &query("view");
if ($status eq "ok") {
print qq|Kid Choose your gift here.

<SELECT NAME=Gift>
<OPTION SELECTED>
<OPTION VALUE=Miniplex - N>25
<OPTION VALUE=Megaplex - N>50
<OPTION VALUE=Gigaplex - N>75
<OPTION VALUE=Sweter Swatch - N>85
<OPTION VALUE=Fridays Certificate - N>225
<OPTION VALUE=Swatch watch -N>500
</SELECT><p>|;
}

$in{$db_cols[$Gen]} = A;
my ($status,@hits) = &query("view");
if ($status eq "ok") {
print qq|Adult Choose your gift here.

<SELECT NAME=Gift>
<OPTION SELECTED>
<OPTION VALUE=Miniplex- A>50
<OPTION VALUE=Megaplex- A>100
<OPTION VALUE=Gigaplex - A>150
<OPTION VALUE=Sweter Swatch - A>175
<OPTION VALUE=Fridays Certificate- A>450
<OPTION VALUE=Swatch watch - A>1000
</SELECT>|;
}

----
But it sends no information

The N is a default for all the kids in the database

and the A for the Adults..

What im trying to do is to give an especific select field for each user type insted of puting just one


Quote Reply
Re: Add a different select field to 2 users In reply to
Just taking a shot here, have you tried using quotation marks in your select variables?

<OPTION VALUE="Swatch watch - A">1000

Edited: I believe you need to change your select coding.
<SELECT NAME=Gift>
<OPTION VALUE="Miniplex- A" SELECTED>50
<OPTION VALUE="Megaplex- A">100
<OPTION VALUE="Gigaplex - A">150
<OPTION VALUE="Sweter Swatch - A">175
<OPTION VALUE="Fridays Certificate- A">450
<OPTION VALUE="Swatch watch - A">1000
</SELECT>|;



Quote Reply
Re: Add a different select field to 2 users In reply to
yes i did thanks

Quote Reply
Re: Add a different select field to 2 users In reply to
I don't believe you are going to get the results you want using:

$in{$db_cols[$Gen]} = A;

as perl will not recognize the "=" sign. A programmer I'm not but that doesn't look right to me.

This is taken from the FAQ noted below under the section "Syntax":

If the value you're trying to compare is a string (which "5-A" is), use eq. If it's a number, then use ==.

You may want to view the various thread references in the FAQ to see if you can follow other examples given.

Hope this helps



Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/