Gossamer Forum
Home : Products : DBMan : Customization :

Select Fields Reset when Modifying

Quote Reply
Select Fields Reset when Modifying
I saw some information on JPDeni's FAQ and some here, but nothing fully answered my question....

Why are my select fields resetting to either the default, or first value when I modify the record?

Here is some background on my setup -
I have 3 select fields, configured one per line in the config:
------------------
%db_select_fields = (
District => 'Northeast, Mid-Atlantic',
Marketplace => 'cut, out, tokeepit, short',
Department => 'also, removed'
);
------------------
Here is the database definition:
------------------
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
District => [1, 'alpha', 0, 255, 1, '', ''],
Marketplace => [2, 'alpha', 0, 255, 1, '', ''],
Department => [3, 'alpha', 0, 255, 1, '', ''],
other fields removed=> [9, 'alpha', -2, 15, 0, '', '']
);
------------------
Here is the section from html_record_form:

------------------
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>District:</FONT></TD>
<TD VALIGN="TOP"> |; print &build_select_field ("District", "$rec{'District'}"); print qq|</TD></TR>
------------------

Example of problem:
As you can see there are two options for "District". If I choose to modify a record that has a value of "Northeast" in that field it will display correctly when the modify record screen is viewed. If "Mid-Atlantic" is the value the modify screen will show the "---" default value. This is the same for any of the other select fields - only the 1st select value will show correctly - all of the others revert to the default when the record is pulled up.

What am I doing wrong? I hope there is something!

Thank You,
Richard Arsenault
IKON Office SOlutions
email: RArsenault@ikon.com



Quote Reply
Re: Select Fields Reset when Modifying In reply to
Rich,

Try removing the spaces between your selections. Rather than:

%db_select_fields = (
District => 'Northeast, Mid-Atlantic',
Marketplace => 'cut, out, tokeepit, short',
Department => 'also, removed'

Use:

%db_select_fields = (
District => 'Northeast,Mid-Atlantic',
Marketplace => 'cut,out,tokeepit,short',
Department => 'also,removed'

This should solve your problem I hope.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Select Fields Reset when Modifying In reply to
Thanks LoisC - it works perfectly now!

Rich