in reply to Re: Doubt about Template Toolkit
in thread Doubt about Template Toolkit

At last...!!!! My solution:

[%# formReference.ttml %] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <TITLE>Please select your option</TITLE> <STYLE type="text/css"> select{display:inline-block;} div{text-align:center; border:1px solid gray;} </STYLE> </head> </head> <body> <form> <input type="hidden" id="preUrl" value="[% pre %]"> <input type="hidden" id="postUrl" value="[% post %]"> <div> <select name="url" id="url" onchange="update();"> [% FOREACH url IN urls -%] <option value="[% url.value %]">[% url.key %]</option> [% END -%] </select> <p id="p"></p> </div> <script type="text/javascript" charset="UTF-8"> function update() { var select = document.getElementById('url'); var option = select.options[select.selectedIndex]; var preUrl = document.getElementById('preUrl').value; var postUrl = document.getElementById('postUrl').value; var newUrl = preUrl + encodeURI(option.value) + "&transient +name=" + option.text + postUrl; document.getElementById("p").textContent = "Reference selec +ted: " + option.text; try { var newWindow ="", '_blank', 'toolbar=0,loc +ation=0,menubar=0'); newWindow.location.href = newUrl; } catch(ex) { document.getElementById('value').value = ex; } } update(); </script> </form> </body> </html>

Thanks all for your valuable help. I appreciate it.

Replies are listed 'Best First'.
Re^3: Doubt about Template Toolkit
by LanX (Saint) on Jul 18, 2022 at 16:47 UTC
    The days were browsers freely allowed sites to open as many windows/tabs as they wanted are thankfully long gone.

    But this might help in a private app, if you allow it explicitly in the browser settings, YMMV.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery