lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lynx-dev] problem with readonly==disabled assumption


From: David Paschal
Subject: [Lynx-dev] problem with readonly==disabled assumption
Date: Mon, 21 Feb 2011 20:22:54 -0800 (PST)

Hi.  Somewhere between Lynx versions 2.8.6 and 2.8.7 a change was made to 
assume that "readonly" text-entry fields on a webpage should get the "disabled" 
attribute applied in Lynx's internal representation of the page.  I suspect the 
intention behind this change was to ensure that the field was actually 
unmodifiable on the page, which it accomplishes successfully.  However, an 
unfortunate side effect of this change is that upon form-submission of a page, 
any "readonly" (and therefore disabled) text fields are omitted from the 
submitted data, causing problems with websites that expect the previous 
read-only data to be provided with the submitted form.  Other web browsers 
(Firefox, IE, Safari, Chrome, etc.) presumably pass the "readonly" data with 
the submitted form the way Lynx used to before this change was made, because 
otherwise such websites wouldn't work properly with those other browsers either.

After some digging, I located the two lines of code that were added between 
these two versions of Lynx that caused this problem to start happening.  
Disabling these two lines (with "#if 0" in the patch below) causes the problem 
to go away, with the much lesser side effect that "readonly" text fields are 
now writeable as before, which in my mind is a much better problem to have than 
an error page on a website that expects "readonly" fields to be resubmitted 
along with a form.  I have been successfully using my own compiled copy of Lynx 
with this change for the past three months as a substitute for the precompiled 
version provided with Fedora 13, with no other adverse effects noted.  I would 
like to request that you apply this patch to the Lynx source tree for future 
releases.  Longer-term, perhaps somebody who is knowledgeable about the design 
of Lynx (since I'm not) could find a different way to implement the "readonly" 
functionality that is separate from the "disabled" functi!
onality.

Since I'm not all that familiar with HTML and especially not with form 
submission, please pardon any incorrect terminology I may have used in this 
message.  :-)

Thanks,
David


--- lynx2-8-7.original/src/HTML.c       2009-06-23 16:53:58.000000000 -0700
+++ lynx2-8-7/src/HTML.c        2010-11-20 15:13:28.641109509 -0800
@@ -4780,22 +4780,24 @@
                 * "[IMAGE]-Submit".  - FM
                 */
                StrAllocCopy(I_value, "Submit");
                I.value = I_value;
            } else if (ImageSrc) {
                /* [IMAGE]-Submit with verbose images and not clickable images.
                 * Use ImageSrc if no other alt or value is supplied. --LE
                 */
                I.value = ImageSrc;
            }
+#if 0
            if (present && present[HTML_INPUT_READONLY])
                I.disabled = YES;
+#endif
            if (present && present[HTML_INPUT_CHECKED])
                I.checked = YES;
            if (present && present[HTML_INPUT_SIZE] &&
                non_empty(value[HTML_INPUT_SIZE]))
                I.size = atoi(value[HTML_INPUT_SIZE]);
            LimitValue(I.size, MAX_LINE);
            if (present && present[HTML_INPUT_MAXLENGTH] &&
                non_empty(value[HTML_INPUT_MAXLENGTH]))
                I.maxlength = value[HTML_INPUT_MAXLENGTH];
            if (present && present[HTML_INPUT_DISABLED])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]