Gossamer Forum
Home : Products : DBMan : Customization :

Data resetting when you modify it.

Quote Reply
Data resetting when you modify it.
We are using DBMan for an Intranet Job Database. Whenever we go in and modify a listing, all the drop down menus reset to their default value for the record we are modifing. For instance, if the drop down menu for Job Status said "Full Time" when we modify it, it resets to "----Job Status----".

The information is correct in the database until we open that record to modify it.

Has anyone else had this problem or are you aware of a fix for that.

------------------
Sean Fay

Aurora Web - Professional Web Hosting loaded with features.
http://www.auroraweb.net
Quote Reply
Re: Data resetting when you modify it. In reply to
If you're having problems with a select list, the problem might be in the way you have defined your options in the .cfg file. (It took me weeks to figure out this problem!)

Make sure that all of your options for that field are on the same line in your .cfg file, no matter how long it makes the line. Don't make it easier to read by hitting the return at the edge of the screen.

I notice that your default option is
"----Job Status----"
Since the build_select_field subroutine has a "---" as the default option, I'm wondering if you might be building the select field directly in your html_record_form subroutine. If you are, your options will not be correct when you modify a record. You need to use the build_select_field subroutine in order to have the correct option selected.


------------------
JPD





Quote Reply
Re: Data resetting when you modify it. In reply to
I think I expressed myself wrong. The default listing for the drop down listings is "*". The user sees "----Any Status----". Once you fill that with "Full Time", when you come back to modify that, it resets to the "*" and you'll see "----"Any Status----".

I think you understood what I was getting at, I just don't think I gave correct or the proper information...sorry. ;-)

I've checked in my config file. Here's what that had listed:

Job_Status => [3, 'alpha', 40, 255, 0, '', ''],
Shift => [4, 'alpha', 40, 255, 0, '', ''],

Here are the search calls in the html.pl file.

<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font>Job Status:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <SELECT NAME="Job_Status">
<OPTION VALUE="*">-----Any Status-----
<OPTION VALUE="Full Time">Full Time
<OPTION VALUE="Half Time">Half Time
<OPTION VALUE="Exempt">Exempt
<OPTION VALUE="Per-Diem">Per-Diem
<OPTION VALUE="Temporary">Temporary
<OPTION VALUE="Other">Other
</SELECT></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font>Shift:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <SELECT NAME="Shift">
<OPTION VALUE="*">------Any Shift-------
<OPTION VALUE="1st Shift">1st Shift
<OPTION VALUE="2nd Shift">2nd Shift
<OPTION VALUE="3rd Shift">3rd Shift
<OPTION VALUE="Days">Days
<OPTION VALUE="Evenings">Evenings
<OPTION VALUE="Nights">Nights
<OPTION VALUE="Day-12">Day-12
<OPTION VALUE="Night-12">Night-12
<OPTION VALUE="Day/Evening">Day/Evening
<OPTION VALUE="Day/Night">Day/Night
<OPTION VALUE="Weekends">Weekends
<OPTION VALUE="Rotating">Rotating
<OPTION VALUE="Variable">Variable
<OPTION VALUE="Other">Other
</SELECT></TD></TR>

I've called them correctly from what I can tell, but no luck.

------------------
Sean Fay

Aurora Web - Professional Web Hosting loaded with features.
http://www.auroraweb.net
Quote Reply
Re: Data resetting when you modify it. In reply to
You need to use the &build_select_field feature.

In your .cfg file, set up your select fields:

%db_select_fields = (
Job_Status => 'Full Time,Part Time,Exempt,Per Diem,Temporary,Other',
Shift => '1st Shift,2nd Shift,3rd Shift,Days,Evenings,Nights,Day-12,Night-12,
Day/Evening,Day/Night,Weekends,Rotating,Variable,Other'
);

(Make sure that all the options for a given select field are on the same line.)

In html.pl, sub html_record_form use the following to print your select fields. (I'm assuming this is within an already existing print qq| statement.)

<TR><TD>Job Status:</TD><TD>|;
print &build_select_field("Job_Status",$rec{'Job_Status'}");
print qq|</TD></TR>
<TR><TD>Shift</TD>|;
print &build_select_field("Shift",$rec{'Shift'}");
print qq|</TD></TR>

and continue with your form.

This is the only way that your fields will be correctly entered when you modify a record.


------------------
JPD