Gossamer Forum
Home : Products : DBMan : Customization :

Date as an added Feild

Quote Reply
Date as an added Feild
Ok, I used Eliots Add Feild mod...twice, Thank you for that. anyways, one of the fields i added was the date field. There is no default value...I set up the .cfg file just like normal for a date feild. When i try to modify anyting, it tells me invalid format, and can not be blank. How can i just get it to fill in a date, or something, preferably when it is modifed 1st after the Mod, then never again.. Thanks

Quote Reply
Re: Date as an added Feild In reply to
Off the top of my head, this is what I came up with.

In sub html_record_form, after

my (%rec) = &get_record($in{'modify'});
if (!%rec) { &html_modify_failure("unable to find record/no record specified: $in{'modify'}"); return; }


add

$rec{'Date'} = &get_date;

If it's a hidden field, you won't have to worry about them changing it. If it's not a hidden field, there's going to be some more work to do to prevent them from changing it -- if it's really important that it not be changed.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Date as an added Feild In reply to
You can stop people changing a returned field simply with a little bit of javascript. In html.pl, add

onfocus="this.blur()"

in the field tag e.g.

<INPUT TYPE="TEXT" NAME="DateOfEntry" VALUE="$rec{'Date'}" SIZE="14" MAXLENGTH="20" onfocus="this.blur()">

HTH, Brian

Quote Reply
Re: Date as an added Feild In reply to
Thanks...as always.....*feels like a little kid sometimes*