Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2011
    Posts
    1
    Rep Power
    0

    Default Event.observe problem

    hello, im trying to change a label(id="label") css, by chaging its class, when the user starts typing in another input text box(id=textbox"),
    the script i wrote is this:

    <script>
    Event.observe( window, 'load', function() {
    var input = document.getElementByid( 'textbox' );
    var label=document.getelementbyid('subtext');
    if (input.value!='')
    label.classname='has-text';
    if (input.value=='')
    label.classname='inline';
    });
    </script>

    what is wrong with it? why its not working?
    in the chrom browser i got the following notice:
    object function event(){[native code]} has no method 'observe'

    thank u for helping!!
    Last edited by yoni101kessler@; 09-07-2011 at 09:07 PM.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,272
    Rep Power
    25

    Default Re: Event.observe problem

    Is this javascript? You'll get better answers on a javascript forum.
    This is a java forum.

Similar Threads

  1. Event Collision (What I call it) Problem.
    By Alerhau in forum New To Java
    Replies: 4
    Last Post: 08-06-2011, 09:10 PM
  2. Layout and button event problem! please help
    By counterfox in forum AWT / Swing
    Replies: 0
    Last Post: 01-28-2011, 12:48 AM
  3. JColorChooser modeless - Event Listener problem
    By siamino in forum New To Java
    Replies: 1
    Last Post: 04-14-2009, 12:39 AM
  4. checking for an event during an event
    By infinity in forum AWT / Swing
    Replies: 22
    Last Post: 04-09-2009, 01:08 AM
  5. problem with event handling!!!
    By ahdus in forum Java Applets
    Replies: 1
    Last Post: 11-17-2007, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •