PDA

View Full Version : [Q] Can you disable the input text in HTML without JavaScript???


CyanBlue
10-20-2003, 05:50 AM
Howdy... ;)

This is my questions...

Can you disable the input text in HTML without JavaScript???

Googling gave tons of examples and tutorials on how to disable it WITH JavaScript, but I was wondering if anybody know if you can do that without the JavaScirpt, that'd be wonderful... ;)

Some of the ones that I have found from the google say that DISABLED tag is supposed to do that on IE 4.0 and above, but it wasn't working on IE 6.0... :(

Anybody??? ;)

JHallam
10-20-2003, 11:14 AM
Hey Jason,

have a look at the DISABLE attirbute (syntax)

works with submit buttons, may be able to get it working with a single text input but without JS you can't swap and pick which should be disabled on consideration of another.

So unless you wanted the input text just to be disabled, always then this would be fine but if you wanted it to be disabled due to interactivity then, "No, you will have to use JS"

Hmmm...actually, you maybe able to do something with little more power without JS with CSS...don't hold me to it! ;)

CyanBlue
10-20-2003, 12:11 PM
Long time no see, GRaPHiX_FReaK... ;)

Yeah... That goes with what I have been searching so far... :(
Amazing to see how hard HTML is comparing to ActionScript... :D

It's just been way too long since I have not used any sort of HTML except the EMBED tag... :D

Okay... This is what I want to do...

I want to display...

ID : 1 <--- Non editable... Display for the reference and passing the value to the next screen purpose...
First Name : someName <--- Editable...
Last Name : someName <--- Editable...

Very simple edit screen of the address book type page...
I have to display ID number as a reference purpose only, and I don't want it to be editable since that's the master key from the database...

I can just output the ID number in a text format(read not inside the input field), but the screen won't look the same... :(

Any more idea on this??? ;)

JHallam
10-20-2003, 12:23 PM
From what I can gather, you could just use

object.disable="true" or something along those lines.

Object being the textbox...ofcourse

hmm...what you trying so far?

CyanBlue
10-20-2003, 12:55 PM
That line sounds like a JavaScript to me... :D

Nah... Still looking for the non-JS solution at the moment...

But I guess I might just fall into that JS trap sooner or later... :D

Thanks, birthday boy... ;)