Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-22-2002, 02:45 PM   PM User | #1
SYMBIO
New Coder

 
Join Date: Oct 2002
Location: London England.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
SYMBIO is an unknown quantity at this point
editable textfields

<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?
__________________
Thanks so much for you help,
Satpal.
SYMBIO is offline   Reply With Quote
Old 11-22-2002, 02:52 PM   PM User | #2
redhead
Regular Coder

 
Join Date: Jun 2002
Location: United Kingdom Confused: Often
Posts: 859
Thanks: 0
Thanked 0 Times in 0 Posts
redhead is an unknown quantity at this point
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/showthre...threadid=10270
__________________
redhead

Last edited by redhead; 11-22-2002 at 04:36 PM..
redhead is offline   Reply With Quote
Old 11-22-2002, 10:32 PM   PM User | #3
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
See if this helps


<input type="text" name="imageselection" contenteditable="false" value="who_cares" />
Mr J is offline   Reply With Quote
Old 11-25-2002, 11:24 AM   PM User | #4
SYMBIO
New Coder

 
Join Date: Oct 2002
Location: London England.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
SYMBIO is an unknown quantity at this point
contenteditable worked! cheers Mr J!
__________________
Thanks so much for you help,
Satpal.
SYMBIO is offline   Reply With Quote
Old 02-03-2003, 08:34 PM   PM User | #5
KrazyKid
New Coder

 
Join Date: Jun 2002
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
KrazyKid is an unknown quantity at this point
Question Disabled CheckBox Property With Enabled Appearance?

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!
KrazyKid is offline   Reply With Quote
Old 02-03-2003, 09:29 PM   PM User | #6
ahosang
Regular Coder

 
Join Date: Sep 2002
Location: Surrey, UK
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
ahosang is an unknown quantity at this point
<input type="text" name="imageselection" onfocus="this.blur()" value="who_cares" />
ahosang is offline   Reply With Quote
Old 02-04-2003, 12:11 PM   PM User | #7
KrazyKid
New Coder

 
Join Date: Jun 2002
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
KrazyKid is an unknown quantity at this point
Internet Explorer hmm...

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...
KrazyKid is offline   Reply With Quote
Old 02-04-2003, 01:36 PM   PM User | #8
ronaldb66
Senior Coder

 
Join Date: Jun 2002
Location: The Netherlands, Baarn, Ut.
Posts: 4,253
Thanks: 0
Thanked 0 Times in 0 Posts
ronaldb66 is an unknown quantity at this point
MStandard...

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:
Quote:
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.

The rest of the polemic on the attribute can be found here
__________________
Regards,
Ronald.
ronaldvanderwijden.com

Last edited by ronaldb66; 02-04-2003 at 02:03 PM..
ronaldb66 is offline   Reply With Quote
Old 02-04-2003, 02:24 PM   PM User | #9
KrazyKid
New Coder

 
Join Date: Jun 2002
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
KrazyKid is an unknown quantity at this point
interesting indeed...

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??!?!
KrazyKid is offline   Reply With Quote
Old 02-04-2003, 06:45 PM   PM User | #10
ahosang
Regular Coder

 
Join Date: Sep 2002
Location: Surrey, UK
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
ahosang is an unknown quantity at this point
onclick="this.checked=false"
Try putting that in there for checkboxes
ahosang is offline   Reply With Quote
Old 02-04-2003, 06:54 PM   PM User | #11
KrazyKid
New Coder

 
Join Date: Jun 2002
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
KrazyKid is an unknown quantity at this point
Thanks ahosang....but...

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 is offline   Reply With Quote
Old 02-05-2003, 07:38 PM   PM User | #12
KrazyKid
New Coder

 
Join Date: Jun 2002
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
KrazyKid is an unknown quantity at this point
Thumbs up Alternative Method To Use

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!!!
KrazyKid is offline   Reply With Quote
Old 01-15-2007, 02:21 AM   PM User | #13
wired00
New to the CF scene

 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
wired00 is an unknown quantity at this point
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

Code:
<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>
wired00 is offline   Reply With Quote
Old 01-15-2007, 03:08 AM   PM User | #14
whizard
Senior Coder

 
whizard's Avatar
 
Join Date: Jan 2005
Location: Philadelphia, PA, USA
Posts: 1,457
Thanks: 10
Thanked 37 Times in 37 Posts
whizard will become famous soon enoughwhizard will become famous soon enough
Quote:
Originally Posted by KrazyKid View Post
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.

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


Dan
__________________
If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.
Step 1: Learn. Step 2: Search. Step 3: Post here.
whizard is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:43 PM.


Advertisement
Log in to turn off these ads.