You are here: Re: Returning an array from javascript to php variable « PHP Programming Language « IT news, forums, messages
Re: Returning an array from javascript to php variable

Posted by Jasen Betts on 10/08/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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация