#16221 closed defect (wontfix)
can't embed <script> tags inside an <input>
Reported by: | unicode_dojo | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Parser | Version: | 1.8.1 |
Keywords: | Cc: | Kitson Kelly | |
Blocked By: | Blocking: |
Description
When I declare an event script for a dijit.form.button, it works if I declare the button as "<button .../>, but it can' work if declare the button.work:
As a "button", it works:
<button data-dojo-type="dijit.form.Button" intermediateChanges="false" label="TEST DECLARATIVE SCRIPT FOR A BUTTON" iconClass="dijitNoIcon" style="position: absolute; z-index: 900; left: 218px; top: 160px;"> <script type="dojo/on" data-dojo-event="click"> alert("I was clicked!"); </script> </button>
As a "input", it can't work:
<input type="button" data-dojo-type="dijit.form.Button" intermediateChanges="false" label="TEST DECLARATIVE SCRIPT FOR A BUTTON" iconClass="dijitNoIcon" style="position: absolute; z-index: 900; left: 218px; top: 160px;"> <script type="dojo/on" data-dojo-event="click"> console.log("I was clicked!"); </script> </input>
OS: WINDOW7 HOME BROWSER: CHROM 18.0, IE9.0, both can't work
Attachments (2)
Change History (4)
Changed 8 years ago by
Attachment: | testform.html added |
---|
Changed 8 years ago by
Attachment: | testscript.html added |
---|
testform.html is the wrong test file; this tesscript.html is right
comment:1 Changed 8 years ago by
Cc: | Kitson Kelly added |
---|---|
Component: | Dijit - Form → Parser |
Resolution: | → wontfix |
Status: | new → closed |
Summary: | dijit.form.button declarative script can't work → can't embed <script> tags inside an <input> |
Right, since the <input> tag isn't allowed to have child nodes, I don't think there's anyway to support what you are asking for. It's more a limitation of the DOM than of dojo itself. That's why we tell people to use <div> in cases like the one you mentioned.
Note: See
TracTickets for help on using
tickets.
The test html file