Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Locate to top of page when req. field validator isvalid=false

Locate to top of page when req. field validator isvalid=false

Scheduled Pinned Locked Moved ASP.NET
javascripthtmltoolshelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Charles I Dont Care About The Back End Sustek
    wrote on last edited by
    #1

    Will this work: 1. I set the EnableClientScript=false on the validators 2. I put the following code in the codebehind: If Page.IsValid = False Then Response.Write("window.location.href=""#TOP"";<" & Chr(47) & "script>") 3. I have an anchor tag in the HTML that looks like this: <a href="TOP"></a> 4. I get a javascript error that says this: Invalid pointer What am I doing wrong? ___________________________________________________________________ <i>Ultimate wisdom from the WebMaster</i>: "You know what...I just don't like that."</x-turndown>

    J 1 Reply Last reply
    0
    • C Charles I Dont Care About The Back End Sustek

      Will this work: 1. I set the EnableClientScript=false on the validators 2. I put the following code in the codebehind: If Page.IsValid = False Then Response.Write("window.location.href=""#TOP"";<" & Chr(47) & "script>") 3. I have an anchor tag in the HTML that looks like this: <a href="TOP"></a> 4. I get a javascript error that says this: Invalid pointer What am I doing wrong? ___________________________________________________________________ <i>Ultimate wisdom from the WebMaster</i>: "You know what...I just don't like that."</x-turndown>

      J Offline
      J Offline
      Jim Taylor
      wrote on last edited by
      #2

      To get the page to browse to an anchor on a page it needs to have a name attribute: FreeWebmasterTips.com - Named Anchors The same can also be acheived by using the scrollIntoView Method: object.scrollIntoView([bAlignToTop]) scrollIntoView Method (A, ADDRESS, APPLET, ...) (Internet Explorer - DHTML) Jim

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups