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. JavaScript
  4. prevent users from entering char in textbox after clicking submit button

prevent users from entering char in textbox after clicking submit button

Scheduled Pinned Locked Moved JavaScript
javascript
4 Posts 4 Posters 1 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.
  • T Offline
    T Offline
    Tridip Bhattacharjee
    wrote on last edited by
    #1

    i want when user click on submit button then a div layer will be generated over the textbox whose height and width will be just the same as textbox and in this way textbox will be blocked for entering something. i want to do it by javascript. in this scenario other textbox will not be blocked.

    tbhattacharjee

    J Z S 3 Replies Last reply
    0
    • T Tridip Bhattacharjee

      i want when user click on submit button then a div layer will be generated over the textbox whose height and width will be just the same as textbox and in this way textbox will be blocked for entering something. i want to do it by javascript. in this scenario other textbox will not be blocked.

      tbhattacharjee

      J Offline
      J Offline
      jaypatel512
      wrote on last edited by
      #2

      Sir, I completely understand your requirement. But I think creating a div above the textbox may not be a good idea. Insted you can just make that particular textbox disabled. In that way he wont be able to modify thosed etails, and it is really very easy to implement this using Jquery or Javascript. $('#div_id).attr('disabled', 'true'); And it will be taken care of.

      1 Reply Last reply
      0
      • T Tridip Bhattacharjee

        i want when user click on submit button then a div layer will be generated over the textbox whose height and width will be just the same as textbox and in this way textbox will be blocked for entering something. i want to do it by javascript. in this scenario other textbox will not be blocked.

        tbhattacharjee

        Z Offline
        Z Offline
        Zhenjie Fu
        wrote on last edited by
        #3

        I think you can set the input text-box to disable status to prevent user enter the new text. please use the like below code:

        document.getElementById("YourID").disabled=true;

        modified on Friday, November 19, 2010 2:39 AM

        1 Reply Last reply
        0
        • T Tridip Bhattacharjee

          i want when user click on submit button then a div layer will be generated over the textbox whose height and width will be just the same as textbox and in this way textbox will be blocked for entering something. i want to do it by javascript. in this scenario other textbox will not be blocked.

          tbhattacharjee

          S Offline
          S Offline
          Sunasara Imdadhusen
          wrote on last edited by
          #4

          You can make text box as disable or readonly.

          sunaSaRa Imdadhusen +91 99095 44184 +91 02767 284464

          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