Opened 11 years ago

Closed 11 years ago

#6585 closed defect (invalid)

dojo/method don't work for dijit.form.ValidationTextBox

Reported by: guest Owned by: bill
Priority: high Milestone:
Component: Parser Version: 1.1.0
Keywords: Cc:
Blocked By: Blocking:

Description

In a ValidationTextBox? I would override the parse function but if I use the dojo/method the parse function doesn't overriden. This is the code:

<input id="test" name="codice" type="text" dojoType="dijit.form.ValidationTextBox?" required="true" trim="true" >

<script type="dojo/method" event="parse" args="value, constraints">

alert(value); if(value == "")

return null;

else

return value;

</script>

Change History (2)

comment:1 Changed 11 years ago by guest

Work around:

<div id="test" name="codice" type="text" dojoType="dijit.form.ValidationTextBox?" required="true" trim="true" >

    <script type="dojo/method" event="parse" args="value, constraints">

        alert(value); if(value == "")

            return null;

        else

            return value;

    </script>

</div>

comment:2 Changed 11 years ago by dante

Priority: highnormal
Resolution: invalid
Status: newclosed

Yes this is invalid, technically. Because input tags are self closing, the dojo/method (which attaches to the node that contains it) technique will not work. You need to use a div (or any other element with a closing tag).

You have provided the solution above. There is an incorrect statement in this book page, corrected by a comment:

http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/common-attributes
Note: See TracTickets for help on using tickets.