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. U can help

U can help

Scheduled Pinned Locked Moved Web Development
javascripthelptutorialquestion
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.
  • D Offline
    D Offline
    davilism
    wrote on last edited by
    #1

    How to call a javascript function when I type in a textbox and hit the Enter button? Thanks.

    A 1 Reply Last reply
    0
    • D davilism

      How to call a javascript function when I type in a textbox and hit the Enter button? Thanks.

      A Offline
      A Offline
      aplope
      wrote on last edited by
      #2

      Hitting the Enter button will submit the form you are working on. You can add an "onchange" attribute to the textbox which will call the javascript. The limitation is, however, that the user has to change some text and then exit the textbox. (IIRC, "onblur" does the same thing only is called ANY time a user exits the text box and not just when text has been entered). There is the "onsubmit" event of a form tag. When the user hits enter, this event is fired. Please note, however, that if you do not want the form to actually be submitted (as in the case of validation, then you have to be sure to return false from your function and have something like

      ..

      Pegmeister

      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