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. Advertising

  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

    "C White" <> wrote in message
    news:41645b52$...
    >
    > <!--
    >
    > function openIt(FAQ) {
    > showIt = document.all(FAQ);
    > if (showIt.style.display == "none") {
    > showIt.style.display = ""
    > } else {
    > showIt.style.display = "none"
    > }
    > }
    > //-->
    > 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
     
    Ray Costanzo [MVP], Oct 6, 2004
    #2
    1. Advertising

  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

    Ray Costanzo [MVP] wrote:
    > 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
    >
    > "C White" <> wrote in message
    > news:41645b52$...
    >
    >><!--
    >>
    >>function openIt(FAQ) {
    >>showIt = document.all(FAQ);
    >>if (showIt.style.display == "none") {
    >>showIt.style.display = ""
    >>} else {
    >>showIt.style.display = "none"
    >>}
    >> }
    >> //-->
    >>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

    >
    >
    >
     
    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

    "C White" <> wrote in message
    news:41645f96$...
    > Can you suggest such a newsgroup as the only ones i can see right now in
    > english are the microsoft.public.inetserver.asp* ones
    >
    > Ray Costanzo [MVP] wrote:
    >> 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
    >>
    >> "C White" <> wrote in message
    >> news:41645b52$...
    >>
    >>><!--
    >>>
    >>>function openIt(FAQ) {
    >>>showIt = document.all(FAQ);
    >>>if (showIt.style.display == "none") {
    >>>showIt.style.display = ""
    >>>} else {
    >>>showIt.style.display = "none"
    >>>}
    >>> }
    >>> //-->
    >>>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

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

    C White Guest

    Thank you, I'll give the ms one a try

    Ray Costanzo [MVP] wrote:
    > 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
    >
    > "C White" <> wrote in message
    > news:41645f96$...
    >
    >>Can you suggest such a newsgroup as the only ones i can see right now in
    >>english are the microsoft.public.inetserver.asp* ones
    >>
    >>Ray Costanzo [MVP] wrote:
    >>
    >>>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
    >>>
    >>>"C White" <> wrote in message
    >>>news:41645b52$...
    >>>
    >>>
    >>>><!--
    >>>>
    >>>>function openIt(FAQ) {
    >>>>showIt = document.all(FAQ);
    >>>>if (showIt.style.display == "none") {
    >>>>showIt.style.display = ""
    >>>>} else {
    >>>>showIt.style.display = "none"
    >>>>}
    >>>>}
    >>>>//-->
    >>>>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
    >>>
    >>>

    >
     
    C White, Oct 6, 2004
    #5
  6. Ray Costanzo [MVP] wrote:
    > ...The MS jscript group is a bit of a ghost town sometimes.


    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

    "Dave Anderson" <> wrote in message
    news:e4I%...
    > Ray Costanzo [MVP] wrote:
    >> ...The MS jscript group is a bit of a ghost town sometimes.

    >
    > 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.
     
    Ray Costanzo [MVP], Oct 7, 2004
    #7
  8. C White

    Bob Barrows Guest

    Re: how to display a message in html when there is no data by using javal scripts

    elsa wrote:
    > i tried to display a message in html when there is no data in the
    > screen by usingl scripts but it is not working...plz sugeest
    >
    > From
    > http://www.google.co.in/search?hl=e...there is nothing in javascript&meta=&aq=o&oq=
    >


    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..

    --
    Microsoft MVP - ASP/ASP.NET - 2004-2007
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows, Oct 1, 2009
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nestor
    Replies:
    6
    Views:
    44,259
    Kevin Spencer
    Apr 25, 2006
  2. UJ
    Replies:
    4
    Views:
    46,534
    pamam
    Apr 24, 2009
  3. Nathan Sokalski
    Replies:
    2
    Views:
    1,011
    Nathan Sokalski
    Oct 13, 2006
  4. Nathan Sokalski

    Design View when using an ASP:Panel to show/hide groups of <tr>'s

    Nathan Sokalski, Oct 12, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    196
    Nathan Sokalski
    Oct 13, 2006
  5. ll
    Replies:
    2
    Views:
    651
    Thomas 'PointedEars' Lahn
    May 1, 2008
Loading...

Share This Page