0

Hello i have a problem. It seems that the value of this this input
<input type="hidden" id="uploadUid" value="<?php echo $sessionUid;?>" name="update_uid">

in here
formData.append('uploadUid', uploadUid.value);

When i put an alert alert(uploadUid.value); on Firefox it returns just fine but on Chrome returns undefined

Any guess why?

3
Contributors
5
Replies
20
Views
4 Months
Discussion Span
Last Post by SimonIoa
0
   <form id="videoform2" method="post" enctype="multipart/form-data" >
                        <div id="preview" class="marginbottom10">
                        </div>
                         <
                        <input type="hidden" id="uploadvalues">
                        <input type="hidden" id="uploadUid"  value="<?php echo $sessionUid;?>" name="update_uid">
                        <input type="hidden" id="uploadToken"   value="<?php echo $sessionToken;?>" name="update_token">
                        <input type="hidden" id="groupId" value="<?php echo $groupID; ?>" name="group_id">
                        </form>

var formData = new FormData();

    formData.append('uploadUid', uploadUid.value);
    formData.append('token', uploadToken.value);
    formData.append('groupId', groupId.value);
0

So just after line 6, the alert on uploadUid.value shows nothing? Remember this is not a new issue/problem. Those priors did not find one cause or cure, just that Chrome may do that.

2

It looks like Chrome does not automatically create the object "uploadUid", and you have to use the function GetElementbyID, as in

var myObj=document.getElementbyID("upLoadUid");
:
:
:
formData.append('uploadUid', myObj.value);
1

i did this instead and worked!
formData.append('uploadUid', document.getElementById('uploadUid').value);

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.