C
Chuck
I'm using a bit of Javascript to pre-select the Select
item from a dropdown, based on the user's previous
choice, and it worked fine as long as I was just posting
to "other", but it won't work on posts to my database.
It just returns the default rather than the previously
selected choice. Here's the code in question:
<%itemToSelect = request.form("Center")%>
<script type "text/javascript"><!--
function PreselectMyItem(itemToSelect)
{
var mydropdown = document.forms(0).Center;
for (i = 0; i < mydropdown.options.length; i++)
{
if mydropdown.options.value == itemToSelect)
{
mydropdown.options.sselected=true;
break;
}
}
}
--></script>
<body onload="PreselectMyItem('<%=itemToSelect%>')">
Then the form method is a post to the database (set up by
FP). I do have the form calling to itself in place of
the confirmation page, but even with the default confirm
page it still doesn't work once the database is involved.
Any ideas what's going on would be appreciated.
Thanks.
Chuck
item from a dropdown, based on the user's previous
choice, and it worked fine as long as I was just posting
to "other", but it won't work on posts to my database.
It just returns the default rather than the previously
selected choice. Here's the code in question:
<%itemToSelect = request.form("Center")%>
<script type "text/javascript"><!--
function PreselectMyItem(itemToSelect)
{
var mydropdown = document.forms(0).Center;
for (i = 0; i < mydropdown.options.length; i++)
{
if mydropdown.options.value == itemToSelect)
{
mydropdown.options.sselected=true;
break;
}
}
}
--></script>
<body onload="PreselectMyItem('<%=itemToSelect%>')">
Then the form method is a post to the database (set up by
FP). I do have the form calling to itself in place of
the confirmation page, but even with the default confirm
page it still doesn't work once the database is involved.
Any ideas what's going on would be appreciated.
Thanks.
Chuck