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. Javascript with Server Controls queries

Javascript with Server Controls queries

Scheduled Pinned Locked Moved ASP.NET
questioncsharpjavascriptasp-netdatabase
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
    Mridang Agarwalla
    wrote on last edited by
    #1

    i have an ASP.net textbox on my form and a dropdownlist too on my form. How can i set the text to "hiii" using JavaScript? IS this correct document.Form1.txtTextBox.value="hiii"; I would also like to set the dropdownlist selected index to 0. How do I do this? As simple as it may sound just bear withe me guys. i really dont know a !@#$ about JavaScript and this is really urgent. I've learnt my lesson though. Tomorrow i'm going to go my self a really good book to teach me this stuff. In the meantime, it'd be great if you could just help me.

    R 1 Reply Last reply
    0
    • M Mridang Agarwalla

      i have an ASP.net textbox on my form and a dropdownlist too on my form. How can i set the text to "hiii" using JavaScript? IS this correct document.Form1.txtTextBox.value="hiii"; I would also like to set the dropdownlist selected index to 0. How do I do this? As simple as it may sound just bear withe me guys. i really dont know a !@#$ about JavaScript and this is really urgent. I've learnt my lesson though. Tomorrow i'm going to go my self a really good book to teach me this stuff. In the meantime, it'd be great if you could just help me.

      R Offline
      R Offline
      RichardGrimmer
      wrote on last edited by
      #2

      You'd need to use document.getElementById(myControlId).value='some text' The thing to watch out for though is that the control name you defined will probably be prefixed with _ctl0_ or something similar. You can use the object.ClientId attribute on the server side to find out what it should be.

      "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

      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