View Full Version : pass dynamic text from html in javascript to php?

07-11-2011, 04:51 PM
not sure what section to post this in, basically i have html in a javascript function that i want to pass into a php.

here is some of my javascript code

var names = document.getElementById('names').value;
var nms = names.split(";;")
for (i=0; i<las.length; i++)
var contentString = [
'<div id="tab-1">',
+'<form action="index.php" method="post" enctype="multipart/form-data">'+
'<input id="delbutton" name="delbutton" type="submit" value="Delete">',+'</form>'
then when the button gets pressed it goes to

echo("into the php delete: " . $_POST['name2'] . "<br />\n");
echo '<pre>' . print_r($_POST,true) . '</pre>';

basically i want to be able to access the value of nms[i] in the php call. i am able to pass anything in <input> tags like normal html, but i want to get nms[i] to go through

what should i do?

07-11-2011, 04:57 PM
That should be just