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
  1. Home
  2. Web Development
  3. ASP.NET
  4. JScript - ASP Wizard Control [modified]

JScript - ASP Wizard Control [modified]

Scheduled Pinned Locked Moved ASP.NET
helpquestionjavasysadmintools
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.
  • M Offline
    M Offline
    MaxRelaxman
    wrote on last edited by
    #1

    I'm a app developer moving into the world of web development so forgive me if this is a stupid question. Is it possible to access a control contained inside an ASP Wizard control in Java Script? I'd rather handle something simple like this on the client side rather than waste server time activating a text box For example: I have a combo box and if the user selects 'other', I want a text box to be enabled. Here's a sample of my script code if(document.getElementById("ddSampleLookup").outerHTML == "Other") {blah blah blah} When my onclose handler for the drop down hits, I get the following error: Microsoft JScript runtime error: Object required I've tried with quotes, without quotes and even with single quotes but still no love. I should mention that when I try without quotes I get the error: "Microsoft JScript runtime error: 'txtNarcoticName' is undefined" instead. Thanks in advance! Edit: I should not that I put this here rather than the Web Development forum because I wasn't sure if this was a Java Script issue or an issue with the wizard control. -- modified at 14:22 Monday 29th January, 2007

    C 1 Reply Last reply
    0
    • M MaxRelaxman

      I'm a app developer moving into the world of web development so forgive me if this is a stupid question. Is it possible to access a control contained inside an ASP Wizard control in Java Script? I'd rather handle something simple like this on the client side rather than waste server time activating a text box For example: I have a combo box and if the user selects 'other', I want a text box to be enabled. Here's a sample of my script code if(document.getElementById("ddSampleLookup").outerHTML == "Other") {blah blah blah} When my onclose handler for the drop down hits, I get the following error: Microsoft JScript runtime error: Object required I've tried with quotes, without quotes and even with single quotes but still no love. I should mention that when I try without quotes I get the error: "Microsoft JScript runtime error: 'txtNarcoticName' is undefined" instead. Thanks in advance! Edit: I should not that I put this here rather than the Web Development forum because I wasn't sure if this was a Java Script issue or an issue with the wizard control. -- modified at 14:22 Monday 29th January, 2007

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The issue is that your client controls all have names created by ASP.NET.  So, you need to insert this script with RegisterClientScriptBlock, and do something like: "if(document.getElementById("" + ddSampleLookup.ClientID + "").outerHTML == "Other")"  ( not corrected for quotes The other option is this: if(document.getElementById("<%ddSampleLookup.ClientID%>").outerHTML == "Other") which can go in your aspx, the <% %> block is server side code. You should also always check that document.getElementById has returned you something, or you will risk this sort of error.

      Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

      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