Gossamer Forum
Home : Products : DBMan : Customization :

&get_date in hidden field

Quote Reply
&get_date in hidden field
I just went back (better now than later!) and added a DatePosted field. I'd like to use the &get_date and have it in a hidden field in the Add form, let users be able to enter a date range on the Search form, and print the DatePosted with the listing.

When I try to add a listing to test it I get:
Date Posted (Can not be left blank)
Date Posted (Invalid date format)

default.cfg has:
'Date Posted' => [26, 'date', 12, 15, 1, &get_date, '']
);

html.pl has:
for sub html_record_form:
<TR><TD ALIGN="Right"><INPUT TYPE="HIDDEN" NAME="Date_Posted" VALUE="$rec{'Date_Posted'}" SIZE="12" MAXLENGTH="15"></TD></TR>

for both sub html_record_form2 and
sub html_record:
<TD VALIGN="TOP"> <INPUT TYPE="DATE" NAME="Date_Posted" VALUE="$rec{'Date_Posted'}" SIZE="12" MAXLENGTH="15"></TD></TR>

Any suggestions?

(Once I get this I'll be able to see if the commify is working in the Price field)
Quote Reply
Re: &get_date in hidden field In reply to
Oops, just realized I posted this in the Discussion....sorry. I'll go post it to Installation.
Quote Reply
Re: &get_date in hidden field In reply to
Here's your problem:

In your .cfg file you have
'Date Posted'

In html.pl, you have
NAME="Date_Posted";
$rec{'Date_Posted'}

You can have either format, but they have to be consistent. Either put the _ between the words in the .cfg file or take it out in the html.pl file.

Actually, this is the place you needed to post the question. I'd really like the other forum to be just for problems on the first installation. Once you have the demo up and running, you should post in here.

But it really doesn't matter. Nothing is enforced. Smile


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