473,395 Members | 1,653 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,395 software developers and data experts.

Text Object - Disable Typing

toxicpaint
Hi there.

I have a text-entry object contained in a form which I'm using to describe pictures as I can write to it easily and it goes well with the look of the site.

I was jus wondernig if there was any way of disabling the user from typing into it without sticking "disabled" in the input tag because I'm using CSS to style the input box and althougbh it looks fine in Firefox, IE keeps the grey shadow as well as the CSS settings.

Does anyone know of a quick JavaScript to solve this?

Thanks!
Sep 28 '06 #1
4 6600
vin
1
Hi there.

I have a text-entry object contained in a form which I'm using to describe pictures as I can write to it easily and it goes well with the look of the site.

I was jus wondernig if there was any way of disabling the user from typing into it without sticking "disabled" in the input tag because I'm using CSS to style the input box and althougbh it looks fine in Firefox, IE keeps the grey shadow as well as the CSS settings.

Does anyone know of a quick JavaScript to solve this?

Thanks!
u culd use the key codes to restrict the input. in this way the style of ur inputbox wil remain the same n on key press nothin wil b entered to the input box. something like this u can do depending on wat all keys u want to restrict the user from entering them. this code wil restrict few keys like no space, no special characters like tht....

<input type="text" id="textbox" name="inputbox" onkeypress="if(event.keyCode < 48 || event.keyCode > 122) event.returnValue=false;if(event.keyCode > 57 && event.keyCode < 65) event.returnValue=false;if(event.keyCode > 90 && event.keyCode < 97) event.returnValue=false;">
Sep 29 '06 #2
That's pretty much what I want! Except I want to block EVERY keyboard entry so that they can't delete the text or backspace it or hit enter..
Sep 29 '06 #3
Can anyone help?

Here's what I'm working on, if it helps...

http://pcwww.liv.ac.uk/~tcowling/virtualtour
Oct 4 '06 #4
It's koay. The solution was to add "readonly/" into the input tag.
Oct 4 '06 #5

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

Similar topics

0
by: Mauro Baraldi | last post by:
Hello World... Someone can help me with a Tkinter doubt. I need to get some data, from a Tkinter text objetc and write to a variable. And, sent to a text objetc some data from a var. Thanks...
1
by: Hans Nowak | last post by:
Howdy y'all, The following works in Python 2.2.2: Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from...
2
by: Tom Fitzgibbon | last post by:
Stupid question: How do I loop through many text boxes on a page and get values for each box and put into an array? For example document.CreateEvent.test1.value will not take an array value...
3
by: Jim | last post by:
I have a text box and a check box, by default the page should load and the text box be disabled..I want it so that when you click the check box the text box diabled = false...but, when you uncheck...
4
by: Stephen Russell | last post by:
I have been tasked to run through textbox and determine it's numeric equivalent. ALL-13A, FLR-145, ZX-1X MAK-145ZD are all valid data in the textbox. 13, 145, 1, 145 are the values I need to...
2
aspamit
by: aspamit | last post by:
I am allowing users to select two months for the period.I have created 12 labels for 12 months. Suppose if user selects Feb to Apr.Only those labels and data should is displayed.Other labels and...
0
by: lenniekuah | last post by:
Hi there I have created a new CrystalReportMerchant.rpt and embedded in VBNET2008 form as CrystalReportViewer. Instead of setting CrysalReport DataSource to either SQL SERVER table or DATASET, I...
19
by: lenniekuah | last post by:
Hi there, Using VBNET2008, Crystal Report 9, SQL SERVER 2000, Northwind database for application purposes. The CrystalReportInvoice.RPT was embedded onto VBNET2008 FORM via CrystalReportViewer1...
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: 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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.