Solved

Microsoft JScript runtime error: (...)' is null or not an object

Posted on 2010-09-07
1
439 Views
Last Modified: 2012-05-10
I get this error in a simple JS - that I'm using to set focus.  THe JS is a page that is hosted in a Masterpage... What is wrong?   Why can't it find this object ?

I look at the source and it's there...

   document.getElementById(<%= cmbPREFIX.ClientID %>).focus()





  function alertSaved() {
        var oWnd = radalert("Constituent Information Added!",300,100, "TRU");
        oWnd.add_close(function () {

// ERROR HERE
                     document.getElementById(<%= cmbPREFIX.ClientID %>).focus()
   

           /// Doesn't work either -   $get('cmbPREFIX').focus();
        });

   
0
Comment
Question by:JElster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 125 total points
ID: 33618640
I think this is a simple case of missing apostrophes:


document.getElementById('<%= cmbPREFIX.ClientID %>').focus() ;

Open in new window

0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question