Posted by Jasen Betts on 09/29/62 11:36
["Followup-To:" header set to comp.lang.javascript.]
On 2006-01-04, Srinivas Aki <srinivas.aki@gmail.com> wrote:
> Hello Everyone,
> I'm trying to read a dynamic table into an array and then return it
> back to the php array so that I can register that for the session. I'm
> not too sure if i'm going in the right direction though. Javascript
> follows.
>
> function get_ticket_cart(){
> var tamt = document.getElementById('tamt');
> var tcells = tamt.cells;
> var total = tcells[tcells.length-1];
> return tcells;
> }
>
> And I'm trying to do this on onClick of the form. Php code follows
>
> $tickets = array();
><input type="submit" value="Pay Dues"
> onclick="<? $tickets ?> = get_ticket_cart();" >
>
> $_SESSION['tickets'] = $tickets;
> session_register('tickets');
>
> I could be wrong in trying to catch the return value. But the problem
> is this needs to be done on the click event.
>
> Any suggestions are appreciated.
client side javascript does not run synchronously with server side PHP.
your PHP has syntax errors.
how are you communicating with the browser? regular form submission or
something else?
Bye.
Jasen
[Back to original message]
|