SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE and this.value?

    below is my code for attaching an eventListener to a textbox. onkeyup I would like to show the value of the textbox.

    this works in FF, but not IE... Does IE not like this?


    Code JavaScript:
    function attachEventListener(target, eventType, functionRef, capture){ 
        //standards 
        if(typeof target.addEventListener != "undefined"){
            target.addEventListener(eventType, functionRef, capture);        
        }else{
            target.attachEvent("on" + eventType, functionRef); 
        }
    }
    function engage(){
        ajaxSearchBox = document.getElementById('ajaxSearchWPBox');
        attachEventListener(ajaxSearchBox, "keyup", keyUp, false);
    }
    function keyUp(){
        alert(this.value);
    }
    attachEventListener(window, "load", engage, false);

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I asked about this earlier.


Bookmarks

Posting Permissions

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