www.webdeveloper.com
Results 1 to 2 of 2

Thread: Object Doesn't Support this property or method

  1. #1
    Join Date
    Oct 2011
    Posts
    350

    Object Doesn't Support this property or method

    Hi..

    I created a function and now I encountered error:

    Object doesn't support this property or method.

    I can't find out now what is the cause of error:

    here is my function code:
    Code:
    <script type='text/javascript'>
    function sequence(varid)
    {
    var a=  varid.indexOf("/")
      var b=  varid.slice(0,a); 
       b =  parseInt(b)
        c= (b+1)
    var f = varid.slice(a); 
    
    
     if (window.event.keyCode==13 || window.event.keyCode==10) {
    
     var lot_number = document.getElementsByName("lot_number")[b].value;
     var lot_number_scan = document.getElementsByName("lot_number_scan")[b].value;
    
    
    var counting = document.getElementsByName("lot_number_scan");
    
    counting = counting.length;
    
     var newid = c + f
    
    lot_number_scan = lot_number_scan.replace(/(LO)/g,"-LO");
    lot_number_scan = lot_number_scan.replace(/-/,"");
    
    
    var check = (new RegExp(lot_number_scan,"gi").test(lot_number)); 
    
       if(check==true && c!=counting)
       {
           document.getElementById(newid).focus();         
       }     
       else if(check==false && c==counting)
       {
          document.getElementsByName("lot_number_scan")[b].value = ''; 
           document.getElementsByName("lot_number_scan").focus();      
       }
       else if(check==true && c==counting)
       {
         document.getElementById("issued_by").focus();      
       }
       else
       {
           document.getElementsByName("lot_number_scan")[b].value = ''; 
           document.getElementsByName("lot_number_scan").focus();     
     
       }
    
    }
    }   
    </script>
    Thank you/

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,356
    Show the rest of your code (HTML and CSS, if any).
    Error may be there and not in the JS portion posted.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles