A JM Posted November 18, 2013 Share Posted November 18, 2013 I'd like to set the value of a hidden object on an iFrame and I'm having a problem... what should be working isn't anyone have any ideas? I set a default value initially but then need to update that value if a file is iedntified, if se then it should update the hidden field on the iFrame. Thatnks for looking. AJM, <!-- The template to display files available for download --> <script id="template-download" type="text/x-tmpl"> <input type="input" id="filename" name="filename" value="Q"> <!-- set default hidden variable to represent no file selected--> {% for (var i=0, file; file=o.files[i]; i++) { %} {% if (file.url.split("/")[7] == '<?php echo session_id()?>') { %} <!-- Skip over files not associated with the session_id() --> {% document.getElementById("filename").value="test"; %} <!-- set hidden variable to file name if it exists --> <tr class="template-download fade"> <td> <span class="preview"> {% if (file.thumbnailUrl) { %} <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a> {% } %} </span> </td> <td> <p class="name"> <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a> </p> {% if (file.error) { %} <div><span class="error">Error</span> {%=file.error%}</div> {% } %} </td> <td> <span class="size">{%=o.formatFileSize(file.size)%}</span> </td> <td> <button class="delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>Delete</button> <input type="checkbox" name="delete" value="1" class="toggle"> </td> </tr> {% } %} {% } %} </script> Link to comment https://forums.phpfreaks.com/topic/284010-having-a-problem-setting-a-getelementbyid-on-a-frame/ Share on other sites More sharing options...
dalecosp Posted November 18, 2013 Share Posted November 18, 2013 The code doesn't show the iframe ... is it in the same domain ... ("Same Origin Policy").... Link to comment https://forums.phpfreaks.com/topic/284010-having-a-problem-setting-a-getelementbyid-on-a-frame/#findComment-1458723 Share on other sites More sharing options...
A JM Posted November 18, 2013 Author Share Posted November 18, 2013 This code is running on the iFrame itself.. should it be implemented differently? I'm a little confused on the iFrame implementation of "document" seems to me if its running on the iFrame it would be the "document" or that specific to the parent? AJM, Link to comment https://forums.phpfreaks.com/topic/284010-having-a-problem-setting-a-getelementbyid-on-a-frame/#findComment-1458774 Share on other sites More sharing options...
A JM Posted November 19, 2013 Author Share Posted November 19, 2013 No other thoughts? Link to comment https://forums.phpfreaks.com/topic/284010-having-a-problem-setting-a-getelementbyid-on-a-frame/#findComment-1458925 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.