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

Posted by Srinivas Aki on 10/09/68 11:36

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.

Thanks
saki

 

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

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