Announcement

Collapse
No announcement yet.

Ajax On Change Save as variable

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ajax On Change Save as variable

    Hello,
    I am struggling with a form. Trying to have an Ajax On Change event get a record id to pass as a variable to another form. I know that this event happens before onValidate but I really would like to have two fields checked for existing records on each field change as separate events and popup a message with button to transfer variables to another form. Here is what I have working on one field but it is not pulling the data into the session to fill in the variable. Variable on both forms is [id]. The Ajax event below is pulling the ID into the form field but the data does not show in session.

    $check_sql = "SELECT ccard_id"
    . " FROM credit_cards"
    . " WHERE cardnumber = '" . {cardnumber} . "'";
    sc_lookup(rs, $check_sql);

    if (isset({rs[0][0]})) // Row found
    {
    {id} = {rs[0][0]};
    $javascript_title = 'ALERT!';
    $javascript_message = 'THE CARD NUMBER YOU ENTERED IS ALREADY IN THE SYSTEM.
    EITHER CLICK THE BUTTON BELOW TO ADD PAYMENTS TO YOUR FILE NUMBER USING THIS CARD OR CLICK THE CLOSE BUTTON';
    $javascript_param = 'modal=Y&width=550&button=Y&button_label=ADD PAYMENTS USING THIS CARD NUMBER&redir=collector_ccard_payments_exs.php&para m1=[id]@param2=[file_number]&redir_target=_self';
    sc_ajax_message($javascript_message, $javascript_title, $javascript_param);
    }
    else // No row found
    {
    {id} = '';
    }

    Many Thanks
    Mark Stopkey
Working...
X