Disabled textbox??

J

JS

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??
 
D

David Dorward

JS said:
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.

When it is disabled then its value is whatever its value is.
String word = (String)request.getParameter("search");

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("notInTheFormAsIJustMadeItUp").
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top