Solved

How do i make a textbox value disable + cannot edit_URGENT

Posted on 2003-10-29
7
892 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

808 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