Show Hide with ASP

Discussion in 'ASP General' started by C White, Oct 6, 2004.

  1. C White

    C White Guest

    Hi All

    It's been several years since I've done any ASP programming and I've
    recently been thrown back into it so I am very rusty, to say the least.

    I use a javascript, in regular html, you click on the link and it
    displays more information below:


    <!--

    function openIt(FAQ) {
    showIt = document.all(FAQ);
    if (showIt.style.display == "none") {
    showIt.style.display = ""
    } else {
    showIt.style.display = "none"
    }
    }

    //-->

    <A href="#" onclick="Javascript:eek:penIt('Answer2'); return false;"><img
    src="images/plus.gif" border="0"></A>&nbsp;Another question?
    <DIV id="Answer2" style="display:none">
    &nbsp;&nbsp;&nbsp;<img src="images/arrow_down.gif">&nbsp;Another answer!!
    </DIV>

    rather than store everything in a static page all the information is in
    a database and I can use the following ASP code to display it:

    'Write the HTML to display the current record in the recordset
    Response.Write (rsCallLog("ID"))
    Response.Write ("&nbsp;<b>")
    Response.Write (rsCallLog("Question"))
    Response.Write ("</b>&nbsp;")
    Response.Write (rsCallLog("Date"))
    Response.Write ("&nbsp;")
    Response.Write (rsCallLog("Answer"))
    Response.Write ("<br>")
    'Move to the next record in the recordset
    rsCallLog.MoveNext

    however this displays both the question and answer, i would like to hide
    the answer until a link is clicked

    now my porblem is this, whenever I try to integrate the show/hode
    javascript I keep getting errors and it displays nothing, I know the
    problem is with how I am coding it, there is somehting wrong with my
    syntax, I know that when you want a quote mark to be displayed as html
    code you have to double the quote mark, but I think I'm missing a lot
    more than that

    I have been trying, very unsuccessully for the last day to find my
    answer on the web and there is nothing about making that javascript work
    in asp

    If anyone can point me in the right direction here that would be greatly
    appreciated

    Thanks
     
    C White, Oct 6, 2004
    #1
    1. Advertisements

  2. This is all client side coding. I suggest you inquire in a client-side
    group. And instead of posting all the response.write things, you should
    paste in the relevant html and javascript from a view-source of your page.

    Ray at work
     
    Ray Costanzo [MVP], Oct 6, 2004
    #2
    1. Advertisements

  3. C White

    C White Guest

    Can you suggest such a newsgroup as the only ones i can see right now in
    english are the microsoft.public.inetserver.asp* ones
     
    C White, Oct 6, 2004
    #3
  4. The groups with "dhtml" in their names, or
    microsoft.public.scripting.jscript. But, it does appear that you are not
    connected directly to MS's news server, so if your news provider has
    comp.lang.javascript, that one's probably the best. I don't really visit
    the client-side groups too often, but I believe that comp.lang.javascript is
    quite active. The MS jscript group is a bit of a ghost town sometimes.

    Ray at work
     
    Ray Costanzo [MVP], Oct 6, 2004
    #4
  5. C White

    C White Guest

    Thank you, I'll give the ms one a try
     
    C White, Oct 6, 2004
    #5
  6. All the more reason to send him over, Ray. If anything makes it a ghost
    town, it's a lack of new threads. Most everything over there gets prompt
    attention.



    --
    Dave Anderson, m.p.s.jscript ghost

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
     
    Dave Anderson, Oct 7, 2004
    #6
  7. And I see the thread was given attention in that group. Good! :]

    Ray at work
     
    Ray Costanzo [MVP], Oct 7, 2004
    #7
  8. C White

    Bob Barrows Guest

    I don't understand what we are supposed to see from that google link.
    If you want some help you are going to need to do a better job of describing
    your situation. Hint: never describe your symptoms using the words "not
    working" or similar generic terms. Show us what you've tried and tell us
    what the results were.
    Also, your google search used the word "javascript". If by "javascript" you
    meant "client-side script", then you're asking in the wrong newsgroup. ASP
    is server-side functionality whose main purpose is to generate html. If
    you're really trying to do this with client-side script then you should post
    your question to microsoft.public.scripting.jscript or
    comp.languages.javascript.

    If on the other hand, you need help using javascript in server-side code,
    then you are in the right place..
     
    Bob Barrows, Oct 1, 2009
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.