Multi-record form onAfterUpdate write to 2nd table / get key for selected records

Following this post
http://www.scriptcase.net/forum/forum/applications/forms/8191-how-to-insert-multiples-records-on-another-table-from-multiples-records-forms

OnScriptInit:: [selected] = array(); //Initialize array
OnAfterUpdate: [selected][] = “(’”.{id}."’)"; //Should add each record to the array
OnAfterUpdateAll: print_r([selected]) ; //should show records in the array

This is what I see (3 records selected - should be 16, 17 & 18 - it shows the 3 records but only the first key)

Array ( [0] => (‘16’) [1] => (‘16’) [2] => (‘16’) )

Figured it out.