Re: Appending current [date] to a database

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 14752
interpreted = N
texte = >Question: I have a pretty simple
here that appends to a database and is >working just fine. However, I just realized that when the data is appended, >the date that is sent is the date the page was loaded, not the date/time the >response is actually generated, so that is kind of screwing up my sort by >date and time setup I have on the results page.I assume the symptom you're trying to avoid is when someone sits there staring at the page for hours, then clicks the submit button. The problem here is that you've stuck the date into the which is sitting on the client's browser. The solution is to use an [Append] context instead, which allows you to set all the field values at the time of submission:Get rid of your $Append in your current form, and then embed [Append] into *discussion.tmpl* (the page that displays after they hit submit).-- discussion.tmpl -- [Append db=responses.db]code=001&date=[date %c]&response=[response]&name=[name]&e-mail=[e-mail][/Append]See how the date doesn't get calculated until after they hit the submit button? All you're doing here is copying all the form variables that you gathered from the previous page, and appending them to the database.Grant Hulbert, V.P. Engineering | ==== eCommerce for the Rest of Us ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Appending current [date] to a database (Gil Poulsen 1997)
  2. Re: Appending current [date] to a database (Grant Hulbert 1997)
  3. Appending current [date] to a database (Gil Poulsen 1997)
>Question: I have a pretty simple here that appends to a database and is >working just fine. However, I just realized that when the data is appended, >the date that is sent is the date the page was loaded, not the date/time the >response is actually generated, so that is kind of screwing up my sort by >date and time setup I have on the results page.I assume the symptom you're trying to avoid is when someone sits there staring at the page for hours, then clicks the submit button. The problem here is that you've stuck the date into the which is sitting on the client's browser. The solution is to use an [append] context instead, which allows you to set all the field values at the time of submission:Get rid of your $Append in your current form, and then embed [append] into *discussion.tmpl* (the page that displays after they hit submit).-- discussion.tmpl -- [Append db=responses.db]code=001&date=[date %c]&response=[response]&name=[name]&e-mail=[e-mail][/Append]See how the date doesn't get calculated until after they hit the submit button? All you're doing here is copying all the form variables that you gathered from the previous page, and appending them to the database.Grant Hulbert, V.P. Engineering | ==== eCommerce for the Rest of Us ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Grant Hulbert

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebCat2 - [format thousands] (1997) [WebDNA] group searching not working as expected. (2010) Separate SSL Server (1997) db merge problem (2002) off-topic: SMS interface? (2001) [WriteFile] problems (1997) mass mailing (1998) OT: Writing help files (2003) [WebDNA] short survey about webdna - please answer if you use webdna :-) (2017) A link and two command (1998) 2 Nt's (1998) using WebCat for Associate Programs? (1998) FAX orders (1996) categorys (1998) Sku numbers (1997) [WebDNA] filter out the exclaimation point (2017) [WebDNA] java and webnda (2017) Checking for WebCatalog Version (2000) [WebDNA] Shucks wendna doesn't work with el capitan (2015) re: date search problem (1999)