Solved

How do i make a textbox value disable + cannot edit_URGENT

Posted on 2003-10-29
7
896 Views
Last Modified: 2010-04-09

Hi,
  LEts say i have a texbox:

<input type="text" name="username" value=<%=username%> size=20 />

How do i make disable so that the user cannot change that value.

Second question:
  LEts 's say a user gets a value from the pop-up calender, or list, the textbox, where the value is put in cannot be edited by the user.
How do i do that?

Thanks
   
0
Comment
Question by:Jasbir21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 5

Assisted Solution

by:apparition
apparition earned 20 total points
ID: 9642780
put a readonly in your text box
<input type="text" name="username" value=<%=username%> size=20  readonly/>
0
 
LVL 15

Accepted Solution

by:
VincentPuglia earned 20 total points
ID: 9643045
two other options:

<input type="text" name="username" value=<%=username%> size=20  disabled = 'disabled' />

or...crossBrowser, crossVersion compatible:

<input type="text" name="username" value=<%=username%> size=20  onfocus=this.blur() />

Vinny
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9644071
or

<input type="hidden" name="username" value="<%= username%> />

and then just write there name on the page

<%
     response.write(request.form("username"))
%>
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Jasbir21
ID: 9647124
Hi,
  when i tried i got the error :
C:\apache\tomcat\work\Catalina\localhost\jsp-examples\org\apache\jsp\jsp2\jas_jsp.java:331: cannot resolve symbol
symbol  : method form (java.lang.String)
location: interface javax.servlet.http.HttpServletRequest
     response.write(request.form("username"));
                           ^
I can't figure out why,thanks
0
 
LVL 15

Expert Comment

by:VincentPuglia
ID: 9647144
if you mean jay's last example -- that is not javascript; it is asp/vbscript

Vinny
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9647728
sorry i thought it was asp

what is it jsp?

if so i no notta about it

0
 

Author Comment

by:Jasbir21
ID: 9648298
oh, jsp is java servlet pages, i am just beginning to learn that ,

Thanks so much for the help, i would be spliting points since both answers were very very helpful. I guess, its' an A with both accepted answers.

Thanks and God bless
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question