Skip to main content
Known Participant
June 15, 2006
Answered

Using ListBox slection to Generate New Recordset

  • June 15, 2006
  • 1 reply
  • 603 views
Hello;

I am new to ASP as well as Dreamweaver 8. I have been able to figure out a lot of things by self teaching but now I am stuck. (perhaps I am exhausted after so many hours!).

I have created an ASP page where I have inserted a dynamic Listbox in it. I have successfuly populated the listbox.

Here is what I m trying to do: when the user makes a selection in the Listbox, I would like to use the "onChange" event (which I still can't figure out how to use it) to generate a Recordset using the value of the selection. The new Recordset will give me a filename (which is in the database) that the user can download by clicking on a link. You could call it a Dynamic Link since everytime the user makes a different selction in the listbox, the link will link to a different filename.

I have been working on this for at least 12 hours and eventhough I usually catchup very quickly, this one I am having a hard time with.

Your help will be greatly appreciated.
This topic has been closed for replies.
Correct answer Newsgroup_User
<a href="javascript:;"
onClick="window.open(document.form1.selectChild.options[document.form1.selectChild.selectedIndex].value,'docWindow','')">Open
Document</a>

"esonline" <webforumsuser@macromedia.com> wrote in message
news:e6uevb$jt1$1@forums.macromedia.com...
>I have tried this as a hyperlink for a text but it does not work!
>
> <a href="document.form1.selectChild.selectedIndex.value">
>
> Any idea to refrence to the value of the listbox. If the above syntax
> worked,
> it would have either openned or downloaded the pdf document!!
>
> Any help would be greatly appreciated
>


1 reply

Inspiring
June 15, 2006
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19117


"esonline" <webforumsuser@macromedia.com> wrote in message
news:e6sjen$apb$1@forums.macromedia.com...
> Hello;
>
> I am new to ASP as well as Dreamweaver 8. I have been able to figure out
> a
> lot of things by self teaching but now I am stuck. (perhaps I am exhausted
> after so many hours!).
>
> I have created an ASP page where I have inserted a dynamic Listbox in it.
> I
> have successfuly populated the listbox.
>
> Here is what I m trying to do: when the user makes a selection in the
> Listbox, I would like to use the "onChange" event (which I still can't
> figure
> out how to use it) to generate a Recordset using the value of the
> selection.
> The new Recordset will give me a filename (which is in the database) that
> the
> user can download by clicking on a link. You could call it a Dynamic Link
> since everytime the user makes a different selction in the listbox, the
> link
> will link to a different filename.
>
> I have been working on this for at least 12 hours and eventhough I usually
> catchup very quickly, this one I am having a hard time with.
>
> Your help will be greatly appreciated.
>


esonlineAuthor
Known Participant
June 16, 2006
Thank You. That works just fine except I have now one last problem: The value of the second listbox (The Child listbox) actually reffers to a file (a pdf document to be exact). What I would like to do is to allow the user to download the file (or even open it in the browser) when they select it. Any idea?

quote:

Originally posted by: Newsgroup User
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19117


"esonline" <webforumsuser@macromedia.com> wrote in message
news:e6sjen$apb$1@forums.macromedia.com...
> Hello;
>
> I am new to ASP as well as Dreamweaver 8. I have been able to figure out
> a
> lot of things by self teaching but now I am stuck. (perhaps I am exhausted
> after so many hours!).
>
> I have created an ASP page where I have inserted a dynamic Listbox in it.
> I
> have successfuly populated the listbox.
>
> Here is what I m trying to do: when the user makes a selection in the
> Listbox, I would like to use the "onChange" event (which I still can't
> figure
> out how to use it) to generate a Recordset using the value of the
> selection.
> The new Recordset will give me a filename (which is in the database) that
> the
> user can download by clicking on a link. You could call it a Dynamic Link
> since everytime the user makes a different selction in the listbox, the
> link
> will link to a different filename.
>
> I have been working on this for at least 12 hours and eventhough I usually
> catchup very quickly, this one I am having a hard time with.
>
> Your help will be greatly appreciated.
>





esonlineAuthor
Known Participant
June 16, 2006
I have tried this as a hyperlink for a text but it does not work!

<a href="document.form1.selectChild.selectedIndex.value">

Any idea to refrence to the value of the listbox. If the above syntax worked, it would have either openned or downloaded the pdf document!!

Any help would be greatly appreciated