cbschne
9 years agoIdeator I
Script tags in form HTML fields
I am trying to generate HTML dynamically in a form's field that is of type HTML, using code in the form's onLoad event.
I am not having any success. Does anyone here know how to do this successfully? The code generates buttons with onclick attributes that call a function.
example:
fileid is a variable
tagText is variable
var Html = '<body><fieldset style="width:175px;background-color:#00000"><legend><b>Help</b></legend><br>';
Html += '<button class="help_me" onclick="downloadFile(' + fileid + ')" >' + tagText + '<br>';
Html += '</fieldset></body>';
Html += '<script>';
Html += 'function downloadFile(fileId) {var inn = parent.thisItem.getInnovator(); var thisFile = inn.getItemById("File",fileId); top.aras.downloadFile(thisFile.node); return false; }';
Html += '</script>';
getFieldByName("htmInstructions").innerHTML = Html;