Shhh, very quiet.

This WebDNA talk-list message is from

2006


It keeps the original formatting.
numero = 66887
interpreted = N
texte = Hello, Its been purty quiet lately so I thought I'd post something. Now some/many? of you probably do this already.. so this is for people who haven't tried this yet. When interacting with a database, there is almost always an ADD, EDIT and DELETE system to build right? Concentrating on just the ADD and EDIT... I use to create two lengthy forms. The edit form auto filled in the form, the add form didn't. For quite some time now, I've been using only one form combined with a append=T in a replace. Here is how it works: 1.) If you are adding. Just link to the page. 2.) if You are editing.. link to the page with the ID of the record to be edited using "theID". ** this assumes that a database will have a unique fieldname (in this case "ID") ** 3.) Put this code in the top of the page: [if ("[raw][theID][/raw]"="[theID]") | ("[raw][theID][/raw]"="")] [then] [ListFields db=thedb.db][text][name]=[/text][/listfields] [/then] [else] [search db=thedb.db&eqIDdatarq=[theID]] [founditems] [ListFields db=thedb.db][text][fieldname]=[interpret][[fieldname]][/interpret][/text][/listfields] [/founditems] [/search] [/else] [/if] 4.) This is your add or edit form (I like to have it in an .inc file)
ETC.
5. ) Put your edit code at the top of the page even above the "IF Then else". [showif [url][action][/url]=addedit] [showif ||[raw]|theID][/raw]|^|[theID]|] [!] **globalid.db is a database with only one field name called "ID" **It is the best way I've found to asign a unique ID safely to allow growth. [/!] [exclusivelock db=globalid.db] [append db=globalID.db&autonumber=ID][/append] [/exclusivelock] [/showif] [exclusivelock db=thedb.db] [replace db=thedb.db&eqIDdatarq=[theID]&append=T][!] [/!]ID=[lastautonumber]&[!] [/!][formvariables name=__&exact=F][!] [/!][getchars start=3][name][/getchars]=[url][value][/ur]&[!] [/!][/formvariables][!] [/!][/replace] [/exclusivelock] [commitdatabase db=thedb.db] [/showif] 6.) I wrote this quickly and spontaneously for this email so there could very well be syntax and spelling problems! This will save you much time in only having to edit one form when there are changes to a database... not only that, but you don't have to edit the replace and search contexts! Cheers, Donovan -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE EUCA Design Center <- Web Development (specializing in eCommerce),-> <- Custom Paint, Labels, and Specialty Signage. -> <- Home and Business Embellishment/Fabrication, -> <- Glass Blowing, and Art Glass -> PH/FAX:> 1 (608) 835-2476 Web:> http://www.egg.bz | http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Shhh, very quiet. ( Kenneth Grome 2006)
  2. Re: Shhh, very quiet. ( Donovan Brooke 2006)
  3. Re: Shhh, very quiet. ( Kenneth Grome 2006)
  4. Re: Shhh, very quiet. ( devaulw@onebox.com 2006)
  5. Re: Shhh, very quiet. ( Kenneth Grome 2006)
  6. Shhh, very quiet. ( Donovan Brooke 2006)
Hello, Its been purty quiet lately so I thought I'd post something. Now some/many? of you probably do this already.. so this is for people who haven't tried this yet. When interacting with a database, there is almost always an ADD, EDIT and DELETE system to build right? Concentrating on just the ADD and EDIT... I use to create two lengthy forms. The edit form auto filled in the form, the add form didn't. For quite some time now, I've been using only one form combined with a append=T in a replace. Here is how it works: 1.) If you are adding. Just link to the page. 2.) if You are editing.. link to the page with the ID of the record to be edited using "theID". ** this assumes that a database will have a unique fieldname (in this case "ID") ** 3.) Put this code in the top of the page: [if ("[raw][theID][/raw]"="[theID]") | ("[raw][theID][/raw]"="")] [then] [ListFields db=thedb.db][text][name]=[/text][/listfields] [/then] [else] [search db=thedb.db&eqIDdatarq=[theID]] [founditems] [ListFields db=thedb.db][text][fieldname]=[interpret][[fieldname]][/interpret][/text][/listfields] [/founditems] [/search] [/else] [/if] 4.) This is your add or edit form (I like to have it in an .inc file)
ETC.
5. ) Put your edit code at the top of the page even above the "IF Then else". [showif [url][action][/url]=addedit] [showif ||[raw]|theID][/raw]|^|[theID]|] [!] **globalid.db is a database with only one field name called "ID" **It is the best way I've found to asign a unique ID safely to allow growth. [/!] [exclusivelock db=globalid.db] [append db=globalID.db&autonumber=ID][/append] [/exclusivelock] [/showif] [exclusivelock db=thedb.db] [replace db=thedb.db&eqIDdatarq=[theID]&append=T][!] [/!]ID=[lastautonumber]&[!] [/!][formvariables name=__&exact=F][!] [/!][getchars start=3][name][/getchars]=[url][value][/ur]&[!] [/!][/formvariables][!] [/!][/replace] [/exclusivelock] [commitdatabase db=thedb.db] [/showif] 6.) I wrote this quickly and spontaneously for this email so there could very well be syntax and spelling problems! This will save you much time in only having to edit one form when there are changes to a database... not only that, but you don't have to edit the replace and search contexts! Cheers, Donovan -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE EUCA Design Center <- Web Development (specializing in eCommerce),-> <- Custom Paint, Labels, and Specialty Signage. -> <- Home and Business Embellishment/Fabrication, -> <- Glass Blowing, and Art Glass -> PH/FAX:> 1 (608) 835-2476 Web:> http://www.egg.bz | http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Donovan Brooke

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:

credit card question (simple) (2001) WebCatalog/Mac 2.1b2 New Features (1997) 2.01 upgrade problems (1997) THANKS (1997) Using Applescript to process WebCatalog functions (1998) customizing the color of user's pages (1997) WCS Newbie question (1997) Username for Admin Group (1997) filemaker - orderfile (1997) RAM variables (1997) Is there a way......... (2000) WebCat Problem? (1999) Error: this shopping cart has already been submitted (2003) Strange sort in search... (2000) [TaxableTotal] - not working with AOL and IE (1997) Mystery authentication (1997) WebDNA Examples (Was Suggestions) (1998) Secure server question (1997) Use of & in text areas.... (1998) HTTP header line is too long? (1997)