I am trying to create a drop down list for “Quick Links”. I have it working properly where I have the href/urls hardcoded for outside sources. I now want to add my in-house links which need to be dynamic for obvious reasons. I run into the problem where it is bring in the actual text and not the values. I read a few of Stan Rogers posts about the tags and I have tried using both .value and .text but I still get the same result.
What can I do so that I can pull the vaules from my fields?
I have the following as computed text:
a:= "" ;
h:= “”;
@If ( @ClientType=“Notes” ; “Quick Links” ; a+h)
Here is my JS function from the script library:
function qlinks(list)
{
var t2 = list[list.selectedIndex].value;
var ft = t2;
openURL(ft,false);
return;
}
Also, is it be possible to center the first value (–Select–) in the list.
Subject: Drop down list and dynamic field references
At first glance it doesn’t look like the last option value is properly formed. AFAIK you can’t just add some javascript to the middle of an option declaration and expect the browser to resolve it.
Assuming all of the variables are available when the document is rendered, would it not be possible just to do the dynamic part in formula language i.e.
a:= "" ;
h:= “”;
@If ( @ClientType=“Notes” ; “Quick Links” ; a+h)
As to centering the Select, once the “value” problem has been solved, it should be the widest element and appear centrally. Failing that the only way AFAIK is to pad the text with spaces until it appears centrally in the required font size / browser.
Subject: RE: Drop down list and dynamic field references
Thank you very much. I created the url via formula and it is working fine. Guess I have been using JS too much and overlooked the simplest method.
As for the center. I have a style on the field that says to make its width 100%, since it is in a table cell. I want to center the first value so that it looks nice, and to also separate the select value from the actual values. I tried to put a style on the individual but with no success.