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

OnClientClick

Scheduled Pinned Locked Moved ASP.NET
javascriptquestion
4 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.
  • R Offline
    R Offline
    Reelix
    wrote on last edited by
    #1

    Hi all! I've been using the OnClientClick with the Button control for awhile now to execute JavaScript without causing page validation: Button1.OnClientClick += "javascript:doThis(); return false;"; but one thing still eludes me... Is it possible to execute the OnClientClick event on a textBox? If anyone can figure out any solution, I would be highly grateful!

    -= Reelix =-

    B 1 Reply Last reply
    0
    • R Reelix

      Hi all! I've been using the OnClientClick with the Button control for awhile now to execute JavaScript without causing page validation: Button1.OnClientClick += "javascript:doThis(); return false;"; but one thing still eludes me... Is it possible to execute the OnClientClick event on a textBox? If anyone can figure out any solution, I would be highly grateful!

      -= Reelix =-

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      try TextBox1.Attributes.Add("OnClick", "javascript:alert('This is just sample');");


      I Love T-SQL "Don't torture yourself,let the life to do it for you."

      R 1 Reply Last reply
      0
      • B Blue_Boy

        try TextBox1.Attributes.Add("OnClick", "javascript:alert('This is just sample');");


        I Love T-SQL "Don't torture yourself,let the life to do it for you."

        R Offline
        R Offline
        Reelix
        wrote on last edited by
        #3

        Thanks! Works perfectly! :D

        -= Reelix =-

        B 1 Reply Last reply
        0
        • R Reelix

          Thanks! Works perfectly! :D

          -= Reelix =-

          B Offline
          B Offline
          Blue_Boy
          wrote on last edited by
          #4

          You are welcome.


          I Love T-SQL "Don't torture yourself,let the life to do it for you."

          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