pre-poluate value in form using onClick ajax event

[SIZE=3]Hi,[/SIZE]
[SIZE=3]I have a grid application (10 fields) and a form application (same fields as grid application + additional fields). Grid and form application are using different table.[/SIZE]
[SIZE=3]On the grid application, I need a link for each record where onclick will direct me to a blank form with values already populated based on the record.[/SIZE]
[SIZE=3]I have done the following in the grid application:[/SIZE]
[SIZE=3]1.[/SIZE] [SIZE=3]Create a virtual field ?Clickhere?.[/SIZE]
[SIZE=3]2.[/SIZE] [SIZE=3]onRecord event: {Clickhere} = ?Click Here?[/SIZE]
[SIZE=3]3.[/SIZE] [SIZE=3]create a new ajax event: [/SIZE]
[SIZE=3]a.[/SIZE] [SIZE=3]Select the field to create an event: Clickhere[/SIZE]
[SIZE=3]b.[/SIZE] [SIZE=3]Select event for Ajax processing: onClick[/SIZE]
[SIZE=3]4.[/SIZE] [SIZE=3]On the ajax event: Clickhere_onClick, I include sc_redir(formA);[/SIZE]
[SIZE=3]I have done the following in the form application:[/SIZE]
[SIZE=3]1.[/SIZE] [SIZE=3]onApplicationInit event, sc_apl_conf(formA,?start?,?new?);[/SIZE]
[SIZE=3] [/SIZE]
[SIZE=3]When I click on the link in the grid application, it will direct me to the blank form. However, I have difficulties in pre-populating those values in the grid application to the form application. Can someone kindly advise? Thanks.[/SIZE]

Maybe you could pass the values using one or more global variables. So your sc_redir would then look something like…

[SIZE=12px] sc_redir(formA, field1={field1};field2={field2};…)[/SIZE]

You could then pick up those values in formA as [field1], [field2] - note the square brackets [].

Nicer still would be to use PHP’s IMPLODE() function to pass them as a single global variable eg “value 1;value 2;value3”. You could then use EXPLODE() to separate them out again.

Hope it helps.