[Top][All Lists]

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

Re: [Lynx-dev] HTML BUTTON element

From: Thomas Dickey
Subject: Re: [Lynx-dev] HTML BUTTON element
Date: Thu, 28 May 2009 16:19:55 -0400 (EDT)

On Thu, 28 May 2009, address@hidden wrote:

According to my trusty SelfHTML reference, a <button> tag is
"totally useless without JavaScriptT", so I see no point in
rendering it to anything else.

Actually the button tag behaviour in all browsers i've tested is to submit
the form in which it is, without any javascript. The reason i'm using it is
because it can be easily styled with css styles.

Moreover, Lynx does not hide it, but renders a useless [BUTTON] text, why?

well, generally speaking, it's because whenever this topic has come up
before, it's someone suggesting that lynx make some special case for
buttons with type=button (a script).

However, you may be talking about a case with a correctly formed page.
For instance, to refresh my memory, I looked at the dtd and see that
if no type is given, the button should be a "submit".  Something like
this would have been a useful patch:

diff -b -u -r1.122 HTML.c
--- HTML.c      2009/05/25 19:53:35     1.122
+++ HTML.c      2009/05/28 20:14:40
@@ -4316,9 +4316,10 @@
            I.value_cs = ATTR_CS_IN;

-           if ((present && present[HTML_BUTTON_TYPE] &&
-                value[HTML_BUTTON_TYPE]) &&
-               (!strcasecomp(value[HTML_BUTTON_TYPE], "submit") ||
+           if (present &&
+               present[HTML_BUTTON_TYPE] &&
+               value[HTML_BUTTON_TYPE]) {
+               if (!strcasecomp(value[HTML_BUTTON_TYPE], "submit") ||
                 !strcasecomp(value[HTML_BUTTON_TYPE], "reset"))) {
                 * It's a button for submitting or resetting a form.  - FM
@@ -4331,6 +4332,10 @@
                HTML_put_string(me, " [BUTTON] ");
+           } else {
+               /* default, if no type given, is a submit button */
+               I.type = "submit";
+           }

             * Make sure we're in a form.

Thomas E. Dickey

reply via email to

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