Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do i make a textbox value disable + cannot edit_URGENT

Posted on 2003-10-29
7
Medium Priority
?
898 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 80 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 80 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 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