I have a hard time to pass a form and its data from a javascript to PhP, in an AJAX environment.
The following JS function receives data from a php code:
function js_admin_users_update(theForm)
{
showform(theForm);
sajax_target_id = 'admindata';
x_p_admin_users_update(theForm);
sajax_target_id = '';
}
(Showform shows details ok)
function showform(theForm)
{
var txt = "Form name: " + theForm.name + "\r\n";
txt += "theForm.elements.length " + theForm.elements.length+"\r\n";
for (var i=0; i
txt += theForm.elements[i].name + " = " +
theForm.elements[i].value + "\r\n";
alert(txt);
}
the function "p_admin_users_update(theForm)" MUST return a $txt that will be displayed, i.e.:
function p_admin_users_update($frm)
{
$txt = "admin_users_update()
";
return ($txt);
}
How do I get variables names and values from the object?
2007-08-26
06:56:34
·
3 answers
·
asked by
just "JR"
7
in
Computers & Internet
➔ Programming & Design