views:

34

answers:

1

HELLO EVERYONE :D

I am having some diffculties passing php varaibles through javascript.

Basically this is the statement:

new Ajax.Updater( 'result', 'update_request.php?status='+status_change);

and I need to pass another variable after status_change, the variable I need to pass is the id of the ticket that is being updated.

So I tried this:

new Ajax.Updater( 'result', 'update_request.php?status='+status_change'&requestid='+request_id);

However this gives me an error stated below:

Webpage error details

Message: Expected ')' Line: 128 Char: 77 Code: 0 URI: http://site_url/dev/time_off_new/main.php

I have tried double quotes, as well as a combination. I do not know why it is giving me such harrassment.

I ran the php script that it is attached to, and everything is working fine. After debugging I have narrowed it down to this statement, so everthing else is working fine.

Thank you ahead of time.

Peace and love!

+2  A: 

You are missing a concatenation operator after the variable status_change

Try this

new Ajax.Updater( 'result', 'update_request.php?status='+status_change+'&requestid='+request_id);
Scott
Looks like that would do it
David Hoerster