Drupal v.4.7.3
CCK v.4.7.0 (with imagefield.module 1.34)
Working on localhost, Windows XP pro sp2, Xampp Apache + MySQL, PHP 5
I want to popup a window with text from a textfield out of a CCK custom node. It only works in FireFox.
I've created a CCK custom node type with a textfield: rows= 15, datasettings= Required, textprocessing= Filtered text.
With the node I've created a custom template file. It contains a call like: drupal_add_js("/scripts/clickInfo.js");
Further I have:
<span class="ct_tracklist" title="click here" onClick="makeDynPopup(<?php print($field_tracklist[0]['view']) ; ?>)">tracklist</span>
The JavaScript function is:
function makeDynPopup(argtext)
{
var mytext = argtext;
var win = window.open("about:blank", "winName", 'width=480,height=240,scrollable=yes,resizable=yes,status=yes');
win.document.open();
win.document.write(mytext);
win.document.close();
}
This works.... in FireFox 1.5.0.6 but not in Opera 9.01 and Internet Explorer 6.029.
The output in the browsers when I 'view source' looks identical, it contains p and br tags with all the text I've entered. When I manually feed a string into the function like this:
<span class="ct_tracklist" title="click here" onClick="makeDynPopup(<?php print("'<p>view<br /> this<p>'"); ?>)">tracklist</span>