Well, after playing around for a while I finally figured it out. Here it is if anyone wants it:
Admin_HTML.pm under
sub html_validate_form ... add the bit of code in bold ...
Code:
$record = $val->array_to_hash ($record);
$form = $db->build_html_record_form ($record, { multiple => 1, hide_key => 1, CategoryID => \&build_category_row_val,
today => 1 });
if ($db->{attach_dir}) {
(This is so it only changes 'Add_Date' when you are Validating a record, otherwise it gets changed for every instance of the form)
DBSQL.pm Add this above # Convert to hash ref if passed array ref.
Code:
$today = &get_date();
Now find ...
Code:
# Display a hidden field.
elsif (${$self->{'db_form_len'}}{$field} == -1) { $output .= qq~<input type=hidden name="$field" value="$value_q">$output\n~; }
... and insert the following line directly after it ...
Code:
# Display Add_Date with todays date when validating a record.
elsif (($field eq 'Add_Date') and $opt->{'today'}) { $output .= qq~<tr><td align=right valign=top width=20%><$font>$field:</font></td><td width=80%><input type=text name="$name" value="$today" size="~ . ${$self->{'db_form_len'}}{$field} . qq~" maxlength="~ . ${$self->{'db_max_length'}}{$field} . qq~"></td></tr>\n~; } That's it.
All the best
Shaun