Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    London England.
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Last edited by redhead; 11-22-2002 at 05:36 PM.
    redhead

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    See if this helps


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

  • #4
    New Coder
    Join Date
    Oct 2002
    Location
    London England.
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    contenteditable worked! cheers Mr J!
    Thanks so much for you help,
    Satpal.

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!

  • #6
    Regular Coder
    Join Date
    Sep 2002
    Location
    Surrey, UK
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <input type="text" name="imageselection" onfocus="this.blur()" value="who_cares" />

  • #7
    New Coder
    Join Date
    Jun 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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:
    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
    Last edited by ronaldb66; 02-04-2003 at 03:03 PM.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #9
    New Coder
    Join Date
    Jun 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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??!?!

  • #10
    Regular Coder
    Join Date
    Sep 2002
    Location
    Surrey, UK
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts
    onclick="this.checked=false"
    Try putting that in there for checkboxes

  • #11
    New Coder
    Join Date
    Jun 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!!

  • #12
    New Coder
    Join Date
    Jun 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!!!

  • #13
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>

  • #14
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    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
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •