[LEFT][SIZE=13px]I want to run an AJAX event in a form so that when a field is clicked it copies the contents of two fields in the current form into another table. I used the Scriptcase macro to do this, but no data is ever sent to the other table. What am I doing wrong? Please see below. My goal is to send the content of two fields in the current form (event_id and username), into two corresponding fields (event_id_requested and username_requested) that are in a table called (requested_events). I’m sure this is child’s play to most of you, but it has me stumped…[/SIZE][/LEFT]
[LEFT][SIZE=13px]/**[/SIZE][/LEFT]
[LEFT][SIZE=13px] * Insert a record on another table[/SIZE][/LEFT]
[LEFT][SIZE=13px] */[/SIZE][/LEFT]
[LEFT][SIZE=13px]// SQL statement parameters[/SIZE][/LEFT]
[LEFT][SIZE=13px]$insert_table = ‘requested_events’; // Table name[/SIZE][/LEFT]
[LEFT][SIZE=13px]$insert_fields = array( // Field list, add as many as needed[/SIZE][/LEFT]
[LEFT][SIZE=13px] ‘event_id’ => “‘event_id_requested’”,[/SIZE][/LEFT]
[LEFT][SIZE=13px] ‘username’ => “‘username_requested’”,[/SIZE][/LEFT]
[LEFT][SIZE=13px] );[/SIZE][/LEFT]
[LEFT][SIZE=13px]// Insert record[/SIZE][/LEFT]
[LEFT][SIZE=13px]$insert_sql = ‘INSERT INTO ’ . $insert_table[/SIZE][/LEFT]
[LEFT][SIZE=13px] . ’ (’ . implode(’, ‘, array_keys($insert_fields)) . ‘)’[/SIZE][/LEFT]
[LEFT][SIZE=13px] . ’ VALUES (’ . implode(’, ', array_values($insert_fields)) . ‘)’;[/SIZE][/LEFT]
[LEFT][SIZE=13px]sc_exec_sql($insert_sql);[/SIZE][/LEFT]