CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Editable Grid: auto-populate a field on load

Print topic Send  topic

Author Message
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.
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.