Autosize Search & Select prompt

On Cognoise.com a solution was shared by hanfrie for automatic size (autosize) of a Search & Select prompt:

Put three HTML Items around the Search & Select prompt, two on the left, one on the right. I call them html1, html2 and html3. Put the following text into html1, html2 and html3 respectively;

html1:

<script language=”javascript”>
function resizeSS(prmt_id)
{
var eleTg1 = document.getElementById(prmt_id);
var selectObject = null;

if (eleTg1 && eleTg1 != undefined)
{selectObject = eleTg1.getElementsByTagName(‘SELECT’);
if (selectObject[0] && selectObject[0] != undefined)
{selectObject[0].style.width = ‘Auto’;}
if (selectObject[1] && selectObject[1] != undefined)
{selectObject[1].style.width = ‘Auto’;}
}
}
</script>

html2:

<div id=”myPrompt”>

html3:

</div>
<script language=”javascript”>
resizeSS(‘myPrompt’);
</script>

I haven’t tested it my self yet. So give it a try!

Leave a Reply

Your email address will not be published. Required fields are marked *