473,385 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Disabled field's value is reading as null

Hi friends,

I've got an error in my project.

<input type="text" name="empname" disabled value=<%=session.getAttribute("emp_name")%>>

and after submitting this,i'm trying to retrieve it as
String emp=request.getParameter(empname);

but it is reading it as null. If i remove the disabled attribute,it reads the value..
Can anyone tell me wats wrong in this and wat shud b done to correct it..
And one more error is that,if session.getAttribute("emp_name") is sachin tendulkar it displays only sachin and its leaving the remaining part except the first name. Please anyone suggest me
Jun 6 '07 #1
3 1534
mrhoo
428 256MB
disabled fields are not submitted with their enabled siblings, which is why you get 'null' instead of ''.

Perhaps you should use readonly instead, which will be submitted but can't be changed by the user.
Jun 6 '07 #2
How to make it as readonly?

disabled fields are not submitted with their enabled siblings, which is why you get 'null' instead of ''.

Perhaps you should use readonly instead, which will be submitted but can't be changed by the user.
Jun 7 '07 #3
How to make it as readonly?

hai anila reddy,

if u make readonly, the text fields ara not editable.making readonly is simple, just remove disable string and place readonly string.thats enough.
ru from andhra?

here is ur code(changed to readonly)
<input type="text" name="empname" readonly value=<%=session.getAttribute("emp_name")%>>
Jun 7 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: lehmann | last post by:
Hello, Is it possible to have a disabled input in a form whose value could be sent when the form is submitted. I just need the user not to be able to change the input value, but this value is...
4
by: kaeli | last post by:
Hi all, I have form elements that I want to not be editable. They should, however, be passed on submission. AFAIK, then, they need to be readonly. (intranet app where elments are created...
3
by: Alan Pocklington | last post by:
Hi, I've created a Java Applet that allows the user to select a record. As the user makes the selection, the applet uses LiveConnect (JSObject) to write the record id to a html field (the name...
1
by: JS | last post by:
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...
3
by: Kelly Domalik | last post by:
I would like to override the "disabled" property of a hidden field. When disabled is set to "true", it would call a function to disable 2 other text fields on the form. When disabled is set to...
3
by: moshi | last post by:
Hey, I'm working with asp.net 2.0. I make objects (like ddl, textbox...) disabled=true in client side. Then, when I get to the server in post action, these objects lose their value. For example:...
9
by: Alan Mailer | last post by:
Ok, my Access 2002 language writing skills are VERY rusty,. I would know how to do what I need using SQL Server's "Coalesce' function, but I don't have that available to me in the Access 2002...
4
by: anilareddy | last post by:
-------------------------------------------------------------------------------- Hi friends, I've got an error in my project. <input type="text" name="empname" disabled...
2
by: CreativeMind | last post by:
hi i have following code but problem is that when i debug both checkboxes have disabled property always false whether it is checked or unchecked..thx for help. function checkFinance(){ var...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.