I am building a custom add_form.html file for DBMan SQL 2. One of the form inputs is for the date. What html code do I add so the current date will auto display in the form?
Jun 19, 2002, 10:03 AM
Staff / Moderator (733 posts)
Jun 19, 2002, 10:03 AM
Post #2 of 5
Views: 4682
You should create a global template called 'get_date':
sub {
my $field_name = shift;
my $tags = GT::Template->tags;
my $home = $tags->{home};
require GT::Date;
GT::Date::date_set_format('%mm%-%dd%-%yyyy%');
$home->{db}->cols->{$field_name}->{default} = GT::Date::date_get();
}
Change add_form.html like:
....
<%get_date('your_date_field_name')%>
<%generate_add_form%>
...
Hope that helps.
TheStone
B.
sub {
my $field_name = shift;
my $tags = GT::Template->tags;
my $home = $tags->{home};
require GT::Date;
GT::Date::date_set_format('%mm%-%dd%-%yyyy%');
$home->{db}->cols->{$field_name}->{default} = GT::Date::date_get();
}
Change add_form.html like:
....
<%get_date('your_date_field_name')%>
<%generate_add_form%>
...
Hope that helps.
TheStone
B.
Aug 6, 2002, 2:14 PM
User (106 posts)
Aug 6, 2002, 2:14 PM
Post #4 of 5
Views: 4580
Do I add this code
<%generate_add_form%>
at the top of the add_form.html? or do I put it in:
Also, I am using the same html page for my add record and modify record so will I have to make two separate html files for these pages since I want to have the date field auto filled? Thanks
Reena
Code:
<%get_date('creationdate')%> <%generate_add_form%>
at the top of the add_form.html? or do I put it in:
Code:
<INPUT name=creationdate type=text value="<%if creationdate%><%creationdate%><%endif%>">Also, I am using the same html page for my add record and modify record so will I have to make two separate html files for these pages since I want to have the date field auto filled? Thanks

Reena