Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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)

testform.html (2.8 KB) - added by unicode_dojo 6 years ago.
The test html file
testscript.html (1.8 KB) - added by unicode_dojo 6 years ago.
testform.html is the wrong test file; this tesscript.html is right

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by unicode_dojo

Attachment: testform.html added

The test html file

Changed 6 years ago by unicode_dojo

Attachment: testscript.html added

testform.html is the wrong test file; this tesscript.html is right

comment:1 Changed 6 years ago by bill

Cc: Kitson Kelly added
Component: Dijit - FormParser
Resolution: wontfix
Status: newclosed
Summary: dijit.form.button declarative script can't workcan'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.

comment:2 Changed 6 years ago by unicode_dojo

Thank you!

Note: See TracTickets for help on using tickets.