Disabled textbox??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JS

    Disabled textbox??

    I have a textbox and a button. Sometimes this textbox will be disabled and
    other times it will be enabled. When its disabled I guess its value is null.
    But is the the text string "null" or is it just nothing??

    I have a function that will need to check the value of this textbox when its
    disabled like:

    <input name="search" type="text" id="search">

    String word = (String)request .getParameter(" search");

    but when its disabled will it make sense to hold null in a String??


  • David Dorward

    #2
    Re: Disabled textbox??

    JS wrote:
    [color=blue]
    > I have a textbox and a button. Sometimes this textbox will be disabled and
    > other times it will be enabled. When its disabled I guess its value is
    > null.[/color]

    When it is disabled then its value is whatever its value is.
    [color=blue]
    > String word = (String)request .getParameter(" search");[/color]

    This looks like Java, not JavaScript. You seem to be in the wrong newsgroup.
    When a control is disabled it is not a successful control. It won't be
    submitted at all. What value your GET/POST parsing library allocates to it
    depends on that library, it will be the same value you get if you try to
    access any parameter which isn't included in the submitted form data (such
    as getParameter("n otInTheFormAsIJ ustMadeItUp").

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    Working...