Situations exist where forcing a submit button doesn't make sense

I have a page built of nothing but display-linked radio buttons. There is no input. Nothing is sent to the server. But, there are radio buttons on the page and EWL complains there isn’t a submit button.

I ran into a page like that recently. I think it’s very rare though, and I don’t think it’s worth changing anything. You can just pass EwfPage.DataUpdatePostBack to the form controls.

Also, in theory, we shouldn’t be using form controls for things that don’t need to go to the server. Can you describe the page or post a screen shot? I’m wondering if it could be reimplemented with other (non-form) HTML elements.

1 Like

I don’t really believe that theory. I don’t think that’s anything in the HTML5 spec that says I can’t use radio buttons as the eyes for a dinosaur cartoon character (okay, ridiculous example). What about a button that displays an alert box? What about a page that works entirely client-side? Then they shouldn’t be in a form element? That’s not our fault- we’re built on Web Forms and Web Forms requires it.

It looks like you’re supposed to omit the name attribute on a field element if you don’t want it to submit:

https://html.spec.whatwg.org/multipage/forms.html#constructing-the-form-data-set

Maybe we can add EWF support for nameless form controls at some point.

1 Like