English 中文(简体)
D. 与Dojo公司一起的退学情况
原标题:Show alert onChange of dropdown with Dojo

所有人,

这里简单的问题——新到来——可能无法工作。

当我改变下降的价值时,我试图发出警告。 采用《公约》。 我的守则如下:

This event gets attached when the page loads...

dojo.query( #inquiry_type select ).connect( onchange , this.Context,  inquiry_type_onchange );

This is the inquiry_type_onchange function...

inquiry_type_onchange: function() {
        alert("changed!");
    }

我的超文本代码,编号为:粉碎箱。

<select name="inquiry_type" id="inquiry_type" class="inquiry_type">
        <option selected="selected" value="">Select Below</option>
        <option value="Place an Order">Place an Order</option>
        <option value="Order Status">Order Status</option>
    </select>

事先感谢任何援助!

问题回答

try this ! http://jsfiddle.net/4Dxxf/1/


 dojo.addOnLoad( function() {
     dojo.connect(dojo.byId( #inquiry_type ), "onchange", function(evt) {
                 alert("changed!");
         console.log("option Changed to: "+evt.target.value);
         dojo.stopEvent(evt);
     });
 });

<select name="inquiry_type" id="inquiry_type" class="inquiry_type">
    <option selected="selected" value="">Select Below</option>
    <option value="Place an Order">Place an Order</option>
    <option value="Order Status">Order Status</option>
</select>

你的问询并不正确。

修改:

dojo.query( #inquiry_type select )

纽约总部

dojo.query( select#inquiry_type )

Also some nice examples are here for Dojo 1.6 http://dojo纽约总部olkit.org/documentation/tu纽约总部rials/1.6/using_query/





相关问题
jquery change() on input box in IE6 - can t remove focus

I have a checkout page that unobtrusively checks to see whether a customer has ordered from us before. After they fill in their e-mail address and focus to the next box, I look up the e-mail and ...

Putting focus on a textbox in onchange event

I am trying to get it so that when a certain value is put into a textbox, the focus will stay on the textbox(and an alert will be shown in production). I am trying to get this to work in Firefox 3.5.7 ...

Javascript onchange different in IE and FireFox

When this onchange event in IE returns false, IE focus stays on that input box. In Firefox the focus always moves to the next field regardless. HTML: input name="seminar_donation" type="text" id="...

dojo dijit client side validation onchange

So I followed the example in the Dojo - Using the Dojo JavaScript Library to Build Ajax Applications to add server-side validation to the username validationtextbox field on my form. Basically I added ...

onchange attribute won t call function

I have an HTML document (here), which creates an iframe-based media player for a collection of songs within albums (I just used letters to define these albums and songs in the mymusic array, for ...

Internet Explorer file input onchange

I have these dynamically created file input HTML elements which are used with a jQuery-ajax file upload plug-in. I would like the file upload to start after the input value has been updated. However,...

热门标签