iBib Posted June 11, 2001 Posted June 11, 2001 I have created a page where the visitors can add new records into the database, but I can't seem to figure out how to display their newly entered information on a confirmation page so that the visitors can validate and if necessary edit the information. I know I must some sort of Token, but should it be something with CurrentRecId (which doesn't work) or something else. Plz assist, I'm feeling silly and disoriented...
scratchmalogicalwax Posted June 11, 2001 Posted June 11, 2001 Have the -Format file exactly the same as the submission form BUT instead of -New have -Edit as the name of the submit ALSO add the FMP-RecordID tag to your form. Populate the form objects with the [FMP-Field: 'fieldname'] replacement tag so the data they entered appears. they can then review and edit their record. This method requires hitting the database twice for each new record once for the -New and once for the -Edit........ ......another way........ ........As far as I know CDML has support for the -Nothing action Anatoli et al will be able to advise there. assuming it does....... Using this name on your submit button you can get WC / Lasso to process a page without refering to a database (can be used to send form info to variables (via form param), inlines (via form param or variable), on a -Format file or in your case set Tokens before the -Format file is returned). So in your first form you can set the text object names to <input type="text" name="-Token.0"><input type="text" name="-Token.1"> etc etc... add the submit button <input type="submit" name="-Nothing" value="Process"> WC (if it supports -Nothing or something similar.....I can't imagine why it wouldn't as it's really useful!) will then process the tokens so you can call the token values (the data entered on the first form) with the token value replacement tag. Put the tags as the value of the text objects on the -Format file as you would a Field replacement you don't need the -DB or -Lay tag on the first form but you will need to state a -Format hope this helps..... [ June 11, 2001: Message edited by: scratchmalogicalwax ]
Vaughan Posted June 12, 2001 Posted June 12, 2001 <goons>What what what what what?</goons> What's this about the -Nothing tag? Plese tell more! We're talking CDML not Lasso, right? Mind you, it'd be nice if there was a -nothing tag in Lasso but not CDML. Then when people ask "what's the difference between Lasso and Web Companion" I could say "-Nothing!"
iBib Posted June 12, 2001 Author Posted June 12, 2001 K, sounds good, but how do I transfer the RecId from the -new format file to the -edit format file??? If I place a token=RecId in my -new format file, it'll display -1 in the -edit format file.
iBib Posted June 12, 2001 Author Posted June 12, 2001 Nevermind, thx alot scratchmalogicalwax it worked fine. I just can't understand how. But it works. Thx alot.
scratchmalogicalwax Posted June 12, 2001 Posted June 12, 2001 lol very good Vaughan, The _nothing tag is sooooo useful there must be a CDML equivelent. Glad I could help iBib, it works because when you tell WC to do something with a record eg -New -Edit etc.. it returns all the values in the Layout that it just worked on (the one you state in the -Lay tag) to the HTML file you specify in the -Format tag (this is why you should split your database across layouts if possible, why clog the memory of the webserver with values you won't display or use!!!) All you have to do then is make the values display by putting the corresponding replacement tag in your HTML The RecID of the record you've added is returned also, this is an internal record identifier used by FMPro and is required on all actions EXCEPT -New and -Find / -FindAll. To make the RecID appear in your RecID hidden form element you just add the corresponding RecID replacement tag (you see a pattern here!) Don't worry about the "other way" thats how I do it but I use Lasso and there are a few differences. The first way works just as well.
iBib Posted June 12, 2001 Author Posted June 12, 2001 Well it does work real fine. So thx again and thx for the lecture (it's always easier to recreate something when you know what's happening... ) [ June 12, 2001: Message edited by: iBib ]
Recommended Posts
This topic is 8634 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now