Highlighting the selected option from a select list.
503714Apr 3 2006 — edited Apr 4 2006Hi,
In my application in a page, say PAGE 5, I'm having a select list using dynamic LOV, say the itemname as P5_X. Whenever I select an option from the list that will take me to next page or the required page say PAGE 25. This is fine. Now if I come back to PAGE 5 I need to highlight the option in the select list (item P5_X) to navigate to the required page (PAGE 25). Likewise for other options in the select list. This is to somehow indicate the user that he has already selected or used that option from the list.
Actually I've written a piece of code in Javascript to highlight the option but after navigating to the required page and when I come back to the PAGE 5 the background color is getting resetted to the original one.
Can somebody help me to resolve this.
-----------------------------------------------------------------------------------------------------------------
Pls find the code below I'm using :
function test()
{
var a=document.getElementById("P5_X");
var x=a.options[a.selectedIndex].value
// Variable x holds page number to navigate.
if (x==0)
{ null; }
else
{
a.options[a.selectedIndex].style.background = "CCFFCC";
location.href='f?p=&APP_ID.:'+ x +':&APP_SESSION.';
//a.options[a.selectedIndex].style.background = "CCFFCC";
}
}
And on the item P5_X, I added the code in HTML Form Element Attributes :
onchange=test()
-----------------------------------------------------------------------------------------------------------------
Thanks,
Ayyappan.