tumby1974
Posts: 26
|
Posted: 03/26/2013, 2:41 PM |
|
How can you auto-populate a field when the editable grid loads up?
Say, you have an editable grid that will show 15 records, and each has a field called date. It's blank at the moment, and I'd like it so when the editable grid page comes up for the first time, it loads the current date into that field for all records. So when they hit submit, the date will be entered into the database.
I tried the "Default Value" in the field's properties, but that doesn't work.
|
|
|
cvboucher
Posts: 191
|
Posted: 03/27/2013, 1:34 AM |
|
What I've done in the past is to set the Custom Insert Type to Table and in the Custom Insert Parameter for that column I select Use Value and use a function to get the current date and time. If this is a required column you will have to change Required to No. Also, you will need at lease one other field in the grid that is populated by the user to signify that this row needs to be inserted. The user won't see the date/time on the webpage but it will get populated in the database.
I've done this in .Net so I can't say for sure if it will work in classic asp, but it should.
Another approach is to give the column a default value on the table definition.
HTH,
Craig
|
|
|
|