...

View Full Version : editable textfields



SYMBIO
11-22-2002, 02:45 PM
<input type="text" name="imageselection" disabled="true" value="who_cares" />doesnt pass the parameter. it just makes a textfield/input all greyed out. how do you make a textfield un-editable but still pass the parameter?

reason why im doing this is because i get the parameter from a child window (people select an image from it)

isnt there a noedit keyword or something? editable=false?

redhead
11-22-2002, 02:52 PM
for <textarea> you can use readonly="readonly". with your input area it should still pass the value even though its disabled...

if poeple are selecting an image couldnt you use <select> or a radio button list?

[edit]
since i posted that another similar thread has appeared:
http://www.codingforums.com/showthread.php?threadid=10270

Mr J
11-22-2002, 10:32 PM
See if this helps


<input type="text" name="imageselection" contenteditable="false" value="who_cares" />

SYMBIO
11-25-2002, 11:24 AM
contenteditable worked! cheers Mr J!

KrazyKid
02-03-2003, 08:34 PM
Other than disabled="true" is there a way to retain the look of an enabled checkbox and still disable it?

I did try the contenteditable="false" but it did not work on IE5.5SP2

Thanks in advance!

ahosang
02-03-2003, 09:29 PM
<input type="text" name="imageselection" onfocus="this.blur()" value="who_cares" />

KrazyKid
02-04-2003, 12:11 PM
I can't seem to make a check box disabled but look enabled.
I am sure that there is a way to to it...any more tips or tricks?

Thanks...

ronaldb66
02-04-2003, 01:36 PM
The contenteditable attribute is not part of any standard and is a MS add-on / "enhancement" / proprietary hack, so beware of browser incompatibility. From a standards promotion point of view, i'd strongly recommend NOT using it.

Update:

did some searching on W3C, and this i didn't want to hold back:
Answering the question if there were "any other cool features", Etan Wexler replied:

Speaking of the Web in general, the putative coolness of a feature is inversely propertional to the utility of the feature. I will leave it at that. :thumbsup:
The rest of the polemic on the attribute can be found here (http://www.google.com/custom?q=contenteditable+attribute&sa=Go&cof=T%3Ablack%3BLW%3A72%3BALC%3A%23ff3300%3BL%3Ahttp%3A%2F%2Fwww.w3.org%2FIcons%2Fw3c_home%3BLC%3A%2 3000099%3BLH%3A48%3BBGC%3Awhite%3BAH%3Aleft%3BVLC%3A%23660066%3BGL%3A0%3BAWFID%3A0b9847e42caf283e%3B&sitesearch=w3.org&domains=w3.org)

KrazyKid
02-04-2003, 02:24 PM
Ronald,
Thanks for the insight.

The reason why I am doing this is I need to display the checked or not checked boxes in a form that is to be printed out...

I do not want the user to check/uncheck the boxes and then print it out with invalid data.

Make sense?

I saw that there was an interestong post here on styling checkboxes but whenver the "disabled" property is set to true it greys the checkbox out regardless of the "style".

Any other ideas??!?!

ahosang
02-04-2003, 06:45 PM
onclick="this.checked=false"
Try putting that in there for checkboxes

KrazyKid
02-04-2003, 06:54 PM
I really need the checkboxes appearance to be normal and the state of the checkbox to remain as it is at the time of page load.

Please keep the suggestions coming!! ;)

KrazyKid
02-05-2003, 07:38 PM
While it is not a <input type="checkbox" name="chk" readonly="readonly" value="0" checked>


if chkbox.checked
<FONT FACE='Wingdings'>x</FONT>
else
<FONT FACE='Wingdings'>o</FONT>
end if

This will not allow the user to alter the displayed data ;)

Hope this helps someone else out!!!

wired00
01-15-2007, 02:21 AM
i got around this by also sending a hidden input value when a checkbox is disabled but must still pass a value (im using PHP IF statement to determine whether its disabled - thus must add the hidden value)

Note, all other non-disabled checkbox values are also passed within the stm_access array



<input type="hidden" name="stm_access[]" value="5008">
<input class="checkbox" type="checkbox" name="stm_access[]" value="5008" disabled="true" checked style="background:#ccc;">Administrator - PMO<br>

whizard
01-15-2007, 03:08 AM
While it is not a <input type="checkbox" name="chk" readonly="readonly" value="0" checked>


if chkbox.checked
<FONT FACE='Wingdings'>x</FONT>
else
<FONT FACE='Wingdings'>o</FONT>
end if

This will not allow the user to alter the displayed data ;)

Hope this helps someone else out!!!

That won't work for anyone on a Mac/Linux computer, unless they somehow have wingdings installed... Not a good idea merely for the sake of looks.

oops, didn't realize this was an OLD thread.. sorry.

Dan



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum