Login Register

can't get hello World tutorial working

Hi,
Im following the hello World tutorial and can get it working when i use the "button" tag. When I use an "input" tag for my submit, as quoted from the Hello World tutorial "In this case we've used a button element for the button though we could have used an input element - Dojo will work with either as long as the dojoType attribute is present." , i get an error. Ive tested with at the most basic level (code below) and is get the following error:

_10.getAttribute is not a function
defineResource(Document hwtut.html)manager.xd.js (line 12)
defineResource(click clientX=0, clientY=0)Button.xd.js (line 12)
toString()dojo.xd.js (line 20)
[Break on this error] dojo._xdResourceLoaded({depends:[["provide","dijit._base.manager"]],defineResour...

I know the require is "dojo.require("dijit.form.Button");" and the "button" tag works, so it seems in order for the "input" type submit to work there would be a require of "dijit.form.Input" or "dijit.form.submit", but I dont see anything like that available.

<head>
                <title>Dojo: Hello World!</title>
                <!-- SECTION 1 -->
                <style type="text/css">
                        @import "http://o.aolcdn.com/dojo/1.0.0/dijit/themes/tundra/tundra.css";
                        @import "http://o.aolcdn.com/dojo/1.0.0/resources/dojo.css"       
                </style>
                <!-- this call to the lib and the parse must be in it's own script tag -->
                <script type="text/javascript" src="http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js" djConfig="parseOnLoad: true">
                </script>

                <script type="text/javascript">
                        dojo.require("dijit.form.Button");
                </script>
        </head>
        <body class="tundra">
<!--     using this type of button results in an error -->
                <input dojoType="dijit.form.Button" id="helloButton2" type='submit' value='Hello World input' label='Hello World input' name='nume'>
                        <script type="dojo/method" event="onClick">
                                alert('You pressed the button');
                        </script>              
                </input>       
<!--     this type works fine -->   
                <button dojoType="dijit.form.Button" id="helloButton">Hello World!
                        <script type="dojo/method" event="onClick">
                                alert('You pressed the button');       
                        </script>              
                </button>

        </body>

You will see the same error

You will see the same error in the button example if you include type='submit'.

Probably due to there being no form to which to "submit" the values??

Hello World!

Hello World!

alert('You pressed the button');

EVEN THIS IS NOT WORKING..????? I M nt able to get ALERT

I'm not sure what you are

I'm not sure what you are trying to accomplish? Are you trying to get the inline script method to work or to get form submission to work?

I suspect the type=submit won't work w/o a form being defined.

I think the alert won't work as long as you have the type=submit in the markup.

[haven't tried either one, just based on what you are reporting]