Solved

How do i make a textbox value disable + cannot edit_URGENT

Posted on 2003-10-29
7
889 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
  • 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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 style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

746 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now