1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

goto_current_link: do nothing on input buttons

The following is in the HTML 4 standard
(<http://www.w3.org/TR/html401/interact/forms.html#push-button>):

    push buttons: Push buttons have no default behavior. Each push
    button may have client-side scripts associated with the element's
    event attributes. When an event occurs (e.g., the user presses the
    button, releases it, etc.), the associated script is triggered.

Currently, a button such created by such HTML as "<input type="button"
value="foo" />" submits the form by default in ELinks.  According to
the above, it shouldn't.
This commit is contained in:
Miciah Dashiel Butler Masters 2008-06-11 14:44:00 +02:00 committed by Kalle Olavi Niemitalo
parent 429e08e073
commit 5733f17856

View File

@ -960,7 +960,8 @@ goto_current_link(struct session *ses, struct document_view *doc_view, int do_re
if (link_is_form(link)) {
struct form_control *fc = link->data.form_control;
if (!call_onsubmit_and_submit(ses, doc_view, fc, do_reload))
if (fc->type != FC_BUTTON
&& !call_onsubmit_and_submit(ses, doc_view, fc, do_reload))
return NULL;
else
return link;