Gossamer Forum
Home : Products : DBMan : Customization :

automate field editing

Quote Reply
automate field editing
I'm using dbman to control a data base with 900 items, each item contains 4 pieces of info. At the moment we add
different gif files to the end of one of these fields. ie -soldout.gif, special.gif....anyhow, these are always changing and at the moment we simply cut and paste the info into the end of the field. <br><img src=SOLD_OUT.gif>. Is there a way to set up check boxes in the field edit area that will automatically insert the various gifs, or reset to no gifs?

I wasn't able to find this in the forum but I may have been using the wrong key words. Thank you as usual.
Steven
Quote Reply
Re: [steven99] automate field editing In reply to
Are you using "auto generate" to create the db display?

Also, when you mention the field edit area - do you mean the config file (db.cfg) or do you mean pulling the record up and editing each one via the webpage in dbman?
Quote Reply
Re: [Watts] automate field editing In reply to
no, I'm not using auto generate. The edit fields I'm refering to are the actual fields, accessed via dbman's web interface. steven
Quote Reply
Re: [steven99] automate field editing In reply to
What you can do to make life easier is to create checkboxes for the options you have.

Sold Out, Special, etc.

Then within the record if any of those are checked then you can display a specific gif. For an example
I'll use 'onsale' of how I set things up.

In .cfg file:

'onsale' => [17,'alpha',0,3,1,'No','Yes|No'], # radio

%db_radio_fields = ( 'onsale' => 'Yes,No' );

You could also setup your graphics in one place and then just use a variable in the display.

$onsale_gif = '<IMG SRC="../../img/onsale.gif" ALT="[ On Sale ]" width=25 height=25 border=0 align=middle>';


-------------

In sub html_record_form:

<TR><TD><$font><B>On Sale?:</B></font></TD><TD>|; print &build_radio_field("onsale",$rec{'onsale'}); print qq|</TD></TR>

In your record display you could use something like this:

|;
if ($rec{'onsale'} eq "Yes") {
print qq$onsale_gif|;
}
else { print qq|&nbsp;|;}

print qq|


Hope that helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/