M
Mtek
Hi,
We have a script where we are changing the innerHTML value. To do
that, we have concatenated a string, and then we set it.
In one of those string is some javascript. The javascript MUST exist
under the control which it is realted to. The code below works fine
if in regular HTML. But, we cannot get it to work when we make it
part of the string like this. We're using some XML, but that is not
the problem, as it works fine when in regular HTML. It is the
middle section that is in question:
str = str + '<table cellspacing="0" cellpadding="0"
style="border-collapse: collapse">';
str = str + ' <tr>';
str = str + ' <td><span class=star>* </span><input
type="text" name="RegDate" id="RegDate" readonly="1" VALUE=' +
getElementTextNS("", "reg_date", r, 0) + '></td>';
str = str + ' <td> <img src="../images/admin2/
calendar_img.gif" id="f_trigger_c" style="cursor: pointer; border: 1px
solid red;" title="Reg Date" onmouseover="this.style.background=\'red
\';" onmouseout="this.style.background=\'\'"></td>';
str = str + ' </tr>';
str = str + '</table><br>';
-- This part is not working.
str = str + '<script>';
str = str + ' Calendar.setup({';
str = str + ' inputField : "RegDate", ';
str = str + ' ifFormat : "%B %e, %Y",';
str = str + ' button : "f_trigger_c",';
str = str + ' align : "Tl",';
str = str + ' singleClick : true });';
str = str + '<\/script>';
str = str + '<BR><CENTER><span class=labels><B>Reg Date</
CENTER></TD>';
str = str + '</TR>';
str = str + '<TR><TD colspan=2><img src=\'../images/rsvp/
spacer.gif\' height=10></TD></TR>';
str = str + '</table>';
str = str + '</CENTER>';
document.getElementById('details').innerHTML = str;
We get no errors, nothing at all. It just does not work when we click
the button. Any suggestions would help us out a lot!
Thanks!
John
We have a script where we are changing the innerHTML value. To do
that, we have concatenated a string, and then we set it.
In one of those string is some javascript. The javascript MUST exist
under the control which it is realted to. The code below works fine
if in regular HTML. But, we cannot get it to work when we make it
part of the string like this. We're using some XML, but that is not
the problem, as it works fine when in regular HTML. It is the
middle section that is in question:
str = str + '<table cellspacing="0" cellpadding="0"
style="border-collapse: collapse">';
str = str + ' <tr>';
str = str + ' <td><span class=star>* </span><input
type="text" name="RegDate" id="RegDate" readonly="1" VALUE=' +
getElementTextNS("", "reg_date", r, 0) + '></td>';
str = str + ' <td> <img src="../images/admin2/
calendar_img.gif" id="f_trigger_c" style="cursor: pointer; border: 1px
solid red;" title="Reg Date" onmouseover="this.style.background=\'red
\';" onmouseout="this.style.background=\'\'"></td>';
str = str + ' </tr>';
str = str + '</table><br>';
-- This part is not working.
str = str + '<script>';
str = str + ' Calendar.setup({';
str = str + ' inputField : "RegDate", ';
str = str + ' ifFormat : "%B %e, %Y",';
str = str + ' button : "f_trigger_c",';
str = str + ' align : "Tl",';
str = str + ' singleClick : true });';
str = str + '<\/script>';
str = str + '<BR><CENTER><span class=labels><B>Reg Date</
CENTER></TD>';
str = str + '</TR>';
str = str + '<TR><TD colspan=2><img src=\'../images/rsvp/
spacer.gif\' height=10></TD></TR>';
str = str + '</table>';
str = str + '</CENTER>';
document.getElementById('details').innerHTML = str;
We get no errors, nothing at all. It just does not work when we click
the button. Any suggestions would help us out a lot!
Thanks!
John