CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2007
    Posts
    13

    Unhappy onclick event problem urgent

    deleted
    Last edited by superstarprogammer; May 8th, 2007 at 03:33 PM.

  2. #2
    Join Date
    Apr 2002
    Location
    PA, USA
    Posts
    1,658

    Re: onclick event problem urgent

    This is wrong for so many reasons

    Below is a corrected solution (untested, but I think it'll be fine).

    1) Javascript allows strings to be quoted with double (") and single (') quotes. Because you need to have a string literal INSIDE the attribute onclick in HTML -- which also is a quoted string -- you need to use single quotes (or &quot inside the attribute string in order to represent a javascript string. Also, you should set your href as well.

    Code:
    <a href=""http://misip249/development/MemberStatements/BinaryData.aspx?name= "& LsStatementName & _
    " onclick=""OpenIssue('http://misip249/development/MemberStatements/BinaryData.aspx?name=" & LsStatementName & "'); return false;"
    Note, I set the href equal to the same link as the javascript version. This allows the page to still load even if the javascript fails for some reason. I also used single quotes for the string literal for the link.
    =--=--=--=--=--=--=--=--=--=--=--=--=--=
    Please rate this post to show your appreciation for those that helped you.

    Before You Post A Question, Please Read This: How & When To Ask Your Question
    =--=--=--=--=--=--=--=--=--=--=--=--=--=

    -eli
    http://www.toad-software.com
    http://www.dailymission.com - Do It Daily

  3. #3
    Join Date
    Apr 2007
    Posts
    13

    Re: onclick event problem urgent

    deleted
    Last edited by superstarprogammer; May 8th, 2007 at 03:30 PM.

  4. #4
    Join Date
    Apr 2002
    Location
    PA, USA
    Posts
    1,658

    Re: onclick event problem urgent

    it'll be easier if you paste me the rendered content. This kind of string building is a pain in the butt to look at without debugging it by looking at the rendered content, so can you get it to compile and paste me that piece of code in rendered HTML? Then I can fix the rendered HTML and you can figure out how to put it into the string that you need.
    =--=--=--=--=--=--=--=--=--=--=--=--=--=
    Please rate this post to show your appreciation for those that helped you.

    Before You Post A Question, Please Read This: How & When To Ask Your Question
    =--=--=--=--=--=--=--=--=--=--=--=--=--=

    -eli
    http://www.toad-software.com
    http://www.dailymission.com - Do It Daily

  5. #5
    Join Date
    Apr 2007
    Posts
    13

    Re: onclick event problem urgent

    the rendered content I am not following what you mean exactly ? Forgive me I am a newbie.

  6. #6
    Join Date
    Apr 2002
    Location
    PA, USA
    Posts
    1,658

    Re: onclick event problem urgent

    if your code compiles, then view it in a browser. Then view source, find the HTML that is produced from the code you showed above, and paste that piece of HTML.
    =--=--=--=--=--=--=--=--=--=--=--=--=--=
    Please rate this post to show your appreciation for those that helped you.

    Before You Post A Question, Please Read This: How & When To Ask Your Question
    =--=--=--=--=--=--=--=--=--=--=--=--=--=

    -eli
    http://www.toad-software.com
    http://www.dailymission.com - Do It Daily

  7. #7
    Join Date
    Apr 2002
    Location
    PA, USA
    Posts
    1,658

    Re: onclick event problem urgent

    Nowhere in the code that you pasted does the text "misip249" appear, which means the important part isn't there. Try again
    =--=--=--=--=--=--=--=--=--=--=--=--=--=
    Please rate this post to show your appreciation for those that helped you.

    Before You Post A Question, Please Read This: How & When To Ask Your Question
    =--=--=--=--=--=--=--=--=--=--=--=--=--=

    -eli
    http://www.toad-software.com
    http://www.dailymission.com - Do It Daily

  8. #8
    Join Date
    Apr 2007
    Posts
    13

    Re: onclick event problem urgent

    deleted
    Last edited by superstarprogammer; May 8th, 2007 at 03:33 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured