weekenthe9 Posted March 20, 2009 Share Posted March 20, 2009 <input type="text" name="someName" readonly="readonly"> This would make the textfield readonly. The question is, is there some string such that <input type="text" name="someName" readonly=""> is NOT readonly? I tried false and empty string, but both of them still makes the textfield readonly P.S.: I do know that not putting the readonly attribute will make the textfield NOT readonly Quote Link to comment https://forums.phpfreaks.com/topic/150354-about-readonlyreadonly/ Share on other sites More sharing options...
weekenthe9 Posted March 20, 2009 Author Share Posted March 20, 2009 errr I don't think I did the strikeout text... Quote Link to comment https://forums.phpfreaks.com/topic/150354-about-readonlyreadonly/#findComment-789643 Share on other sites More sharing options...
weekenthe9 Posted March 20, 2009 Author Share Posted March 20, 2009 Sorry about that, I accidentally used an html tag.. Let me repost: <input type="text" name="someName" readonly="readonly"> This would make the textfield readonly. The question is, is there some string [someString] such that <input type="text" name="someName" readonly="[someString]"> is NOT readonly? I tried false and empty string, but both of them still makes the textfield readonly P.S.: I do know that not putting the readonly attribute will make the textfield NOT readonly Quote Link to comment https://forums.phpfreaks.com/topic/150354-about-readonlyreadonly/#findComment-789644 Share on other sites More sharing options...
Mark Baker Posted March 20, 2009 Share Posted March 20, 2009 This is a case of standards making thing sappear more complex than they might otherwise need be: The original htnml syntax was <input type="text" name="someName" readonly> nice simple and straightforward but also invalid if you try to parse it as an XML document because an attribute in XML must have a value so for XHTML compliance, a value must be provided for every attribute giving <input type="text" name="someName" readonly="anyoldthing"> so now it is compliant DTDs don't enforce ranges of values for an attribute (although xsd can do so), so there's nothing to validate what you actually define as the readonly value, just that there must be one. I suspect that most browsers still take the more simplistic approach to this and ignore the value of the readonly attribute, caring only that it is set You'll find a similar idiosyncracy for select boxes where <option selected> has to be <option selected="selected"> for XHTML compliance Quote Link to comment https://forums.phpfreaks.com/topic/150354-about-readonlyreadonly/#findComment-789661 Share on other sites More sharing options...
ToonMariner Posted March 20, 2009 Share Posted March 20, 2009 very percuiliar... when using readonly you should always use readonly="readonly"... of you don't want the textbox read only simply don't put readonly in. This will let users input data into the field. the other attribute that behaves in a similar fashion is disabled="disabled" which leaves the whol etextbox greyed out and uneditable... Quote Link to comment https://forums.phpfreaks.com/topic/150354-about-readonlyreadonly/#findComment-789727 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.