Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8158641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:40:21+00:00 2026-06-06T17:40:21+00:00

/* listen for the submit button press */ YAHOO.util.Event.addListener(webserver.result_form, ‘submit’, webserver.result_submit); I have this

  • 0
/* listen for the submit button press */

YAHOO.util.Event.addListener(webserver.result_form, 'submit', webserver.result_submit);

I have this event listener in my main.js. Is there any way in YUI so I can listen a variable, so when this variable changes the event occurs. I was wondering if there is something like :

YAHOO.util."Variable".addListener(webserver.result_form, 'submit', webserver.result_submit);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:40:23+00:00Added an answer on June 6, 2026 at 5:40 pm

    you can not directly assign listener to javascript variable but you can do it indirectly in following manner.

    you can save the value of a variable in a div or any html node

    e.g.

    <div id="variable-name" style="display:none;">variable-value</div>
    

    or

    <span id="variable-name" style="display:none;">variable-value</span>
    

    and then use following js to monitor any change in the node.
    This will work in YUI3 or above. ( I am not sure about YUI2.x)

    var Y = YUI().use('node', 'event', function (Y) {
        // node and event modules are loaded.
    });    
    var demo = Y.one('#variable-name');
        // And we can listen for DOM events.
            demo.on('change', function (e) {
                alert('value changed');
            });
    

    for more info about listening for events to YUI node

    http://yuilibrary.com/yui/docs/event/#listening-for-events

    and lists of events available

    http://yuilibrary.com/yui/docs/event/#event-whitelist

    EDIT

    based on http://www.quirksmode.org/dom/events/change.html,

    change event only fires if its form field

    e.g. input textarea and select

    so change event will not fire when contents of div is changed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I listen to click event on a ListView? This is what I
I tried to listen file change event in BlackBerry base on FileExplorer example, but
I would like to listen for the mouse over event in GWT 1.6. Since
Say if I listen for an event: Subject.NewEvent += delegate(object sender, NewEventArgs e) {
i would like to have an event fired in jquery, if the validators of
I have a form that submit a shopping cart to Google Checkout. The form
I have several forms on a webpage to submit responses corresponding to each listed
I have a form like this: <form id=form_main name=form_main action=/search/ target=iframe001 method=get onSubmit=reset_and_subm();> Enter
I have a number of files checked out with changes ready to submit. I
I need to enable a submit button on my form once the user enters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.