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. Limiting input in textbox

Limiting input in textbox

Scheduled Pinned Locked Moved ASP.NET
questionjavascriptsysadmintoolshelp
3 Posts 3 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.
  • N Offline
    N Offline
    Ni Na
    wrote on last edited by
    #1

    Hi I have a screen that needs to limit the comments field to 450 charaters. I have set the Maxlength to 450 but it still allows the user to carry on typing. I have also tried using a javascript function but it is causing a server script error on this screen. The record is then submitted and sent via workflow to an approver but when the approver wants to approve it an error message appears saying that the string has been truncated and the statement terminated. Any idea on how to prevent this error? How do I limit the input?

    J9

    E I 2 Replies Last reply
    0
    • N Ni Na

      Hi I have a screen that needs to limit the comments field to 450 charaters. I have set the Maxlength to 450 but it still allows the user to carry on typing. I have also tried using a javascript function but it is causing a server script error on this screen. The record is then submitted and sent via workflow to an approver but when the approver wants to approve it an error message appears saying that the string has been truncated and the statement terminated. Any idea on how to prevent this error? How do I limit the input?

      J9

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      are you using textmode:multiline as it doesn't work for this you could try a custom validator for the textbox and set the limit to 450

      1 Reply Last reply
      0
      • N Ni Na

        Hi I have a screen that needs to limit the comments field to 450 charaters. I have set the Maxlength to 450 but it still allows the user to carry on typing. I have also tried using a javascript function but it is causing a server script error on this screen. The record is then submitted and sent via workflow to an approver but when the approver wants to approve it an error message appears saying that the string has been truncated and the statement terminated. Any idea on how to prevent this error? How do I limit the input?

        J9

        I Offline
        I Offline
        ice hotty
        wrote on last edited by
        #3

        if the textbox is muilti rows, the maxlenth is invalid.. so you can use the javascript ... can you show the javascript error on your screen?

        Study...

        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