My External Memory

Create a custom ’thank you’ page on web form submission with a simple URL pass through.

July 7 2010 04:25:04 PM




Lets say that you want the fields for "Agency Name" and a 'Transaction Number' field passed through to a thank you page where the end user can print off a basic receipt notating that they filled out your fancy online form for their future reference.


On the form, you need to build a URL containing field values in your submit button.  For this example, the fields to capture are:

agencyname
transactnum

Your submit button will need the following code:

@Command([FileSave]);
@URLOpen("/YOURDATABASE.nsf/YOURCUSTOMTHANKYOU.html?OpenForm&agencyname=" + agencyname +"&transactnum="+transactnum+"")



Next you need to set up your thank you/receipt form.

Create a Computed For Display (CFD) field called 'Query_String_Decoded', and set it's value to 'Query_String_Decoded'.

Create a CFD field called 'QueryList' and set it's computed value to:
sParams := @ReplaceSubstring(@RightBack(Query_String_Decoded;9);"%20";" ");@Explode(@Explode(sParams;"&");"=")

Now you just need to set up CFD fields for agencyname and transactnum.  

The default value for agencyname should be set to:

loc:=@Member("agencyname";QueryList);
@If(loc=0;"";@Subset(@Subset(QueryList;loc+1);-1))

The default value for transactnum should be set to:

loc:=@Member("transactnum";QueryList);
@If(loc=0;"";@Subset(@Subset(QueryList;loc+1);-1))


That's really all there is to it.  You can obviously add more values to your URL and fields to catch the information.  


Comments Disabled
<$DXTemplateBlock Name="HTMLBottom My Brain"$>