works:
<form class=filter onsubmit="alert('submit');">
<span class=a></span>
<span class=b> <input type=text name=b /> </span>
</form>
doesn't work:
<form class=filter onsubmit="alert('submit');">
<span class=a></span>
<span class=b> <input type=text name=b /> </span>
<span class=c> <input type=text name=c /> </span>
</form>
By work, I mean that when I type in text and hit enter, the form onsubmit is called (a simple alert). Why doesn't it fire in the second case? What is the best way to fix it or get around it? I could put a separate onchange event on each input in the html, or add the events through javascript/JQuery. Is that the best approach?
I've got a "table" built from divs for rows and spans for entries. The form is one row in the table. Wrapping the inputs inside spans makes the formatting (mainly column widths/spacing) more uniform. Then the actual input element is set to 80% of the span width.