Hi when I post something with the hidden control I'm getting [object]. I cant see the string.
its like this:
this is in edit.php
<?PHP
//note that I've kept this outside the form
echo "<input type='hidden' name='filename' value='$filename' />" ;
?>
<form>
....
</form>
this is in backendajax.js which is used with edit.php using javascript src="backend.js"
xmlHttp.open("GET", "updatedetails.php?filmname=" + name +"&musicDir="+ musicDir+"&writer="+ writer+"&filename="+ filename, true);
this is in edit_back.php
$filename = $_GET['filename'];
now when I print $filename it is priniting as "[object]" with the brackets.
all the other fields are working fine.Problem is with this only.
Thanks in advance
getting object inplace of string
Moderator: General Moderators
Re: getting object inplace of string
I think your getting [object] because the javascript is adding the input object to the xmlHttp string. instead of the inputs value
Try
filename.value
I think the reason it might work on text fields and not hidden is that a text field might value might default to its value. That bit is just a wild guess.
Hope that helps
Try
filename.value
Code: Select all
xmlHttp.open("GET", "updatedetails.php?filmname=" + name +"&musicDir="+ musicDir+"&writer="+ writer+"&filename.value="+ filename, true);
Hope that helps