08-19-2002, 11:48 AM
I have a scrolling textarea which scrolls the title column from a table. They inform people of meetings, events etc. For example a title may read "meeting on 3rd of December". When the use clicks on one of these titles I would like the contents of the message column from the same table to be displayed. this column gives the user more info on the event/meeting.
I would like the content to be displayed in a div tage underneath the scroller.
My problem is, I'm not sure how to retrieve the contents of the message column into the div tag. I know all the SQL I will need to use and know how to set-up div tags but what do I need to do to get it to work when the user clicks the link?
Any help would be appreciated.
i'm not sure I understand your problem.
i suppose you want the info to be displayed in a floating box when the user selects an item in your text area.
now, i never used this because the selecting and showing of the info then completely runs on the users PC (you drag the floating box in when the user makes his selection) and you need to send all that info when the page originaly loads. i would work with two pages (into one frameset to make it look like one page):
- one with all the items from the title colum;
- one where the info will be displayed .
with an 'action=info.asp target=page2 onclick:submit();' statement in the form-tag of the first page, you can than activate the asp page where the select-statement to retrieve the info is run, and then display this info in the second frame (page2).
i think it's possible to do the floating-box trick, buth i don't think it's the best way to go. i just tried it with one floating box, and it took me some time to generate the correct html
hope this helps you a bit further
08-19-2002, 03:52 PM
I can't seem to get that to work. Does the onClick go in the form tag?
sorry. my mistake. it should be in tag of the form-element. if you would use a listbox, it would be something like
<select id="select1" name="sorts" size="10" onclick="submit();">
(it's probably wiser to use a list box than a text area. if you do use a text area, you could just as well show a collection of links and puth the selection-condition in the querystring. Like that, you don't need a form and the onclickj etc
do while rsLinks.EOF=false
Response.Write(rsLinks.Fields("name o variable with text for link"))
rsLinks is the recordset you now use to make your first selct. info.asp is the asp where you select the extra info-text to display in the page2-frame in the same window. InfoID is the concition you use in the select on info.asp .
08-19-2002, 04:37 PM
I've realised that I'm not using a textarea at all. I have the titles scrolling through div tags. Will that example still work?
well, first of all : the example code from my last post generates a list of links with the content of your title-colom in it (seperated by a break between each link.) when you click one of them, it calls for the info.asp page and takes an ID with it in the querystring.
(if both the title and content are in the same table, and there is aan ID in this table, say "messageID", you could pass this ID along via the querystring. just replace the "name_of_varible_with_InfoID" then by this "messageID"
if you try it out, and you look at the code when you browse the page, you wll see it generates straigth html (as asp always does).
you can generate this linklist into a floating box by placing this code between the div-tags. (as if you would insert it manually)
i don't know about your scrolling part. how do you make them scroll ? i suppose you use a small script to let the content of the floating box scroll, so i expect it would still work with this generated list.