[jQuery] Re: Calling other functions inside a function

2009-07-22 Thread evanbu...@gmail.com

Thank you. The Firebug suggestion was helpful.  The error message is
saying that getDirectorIds() is not defined.

script type=text/javascript
// make sure at least one checkbox is checked
function validateSubmit() {
if( $(input:checkbox:checked).length == 0 ) {
 alert( Please select at least one section for your PDF profile );
 return false;
 } else {
 createCharts();

 // error occurs here
 getDirectorIDs();
 return true;
 }
 }
/script

This is the getDirectorIDs() function:

script language=javascript type=text/javascript
 // this gets all of the director id_individual values
 $(document).ready(function getDirectorIDs() {
 var result = ;
 $(.chkDirector:checked).each(function() {
 result = result + $(this).val() + ,;
 });
 // place the selected id_individual values in the label control
lblCheckedDirectors2
 document.getElementById('lblCheckedDirs').value = result;

 alert(cool);
 });
/script

On Jul 21, 7:28 pm, Michael Geary m...@mg.to wrote:
 The reason this would happen is that you have a fatal error somewhere inside
 your createCharts() function. When this error occurs, it stops all
 JavaScript execution for the current event.

 Do you have any debugging tools such as Firebug? If not, install Firebug and
 try again. Open the Firebug panel and make sure it's enabled for your site,
 then reload the page and do whatever you need to do to trigger the error.

 It's very likely that Firebug will give you an error message showing exactly
 what the problem is.

 If the problem isn't clear from that message (or if you don't get one), try
 sprinkling the code inside createCharts() with console.log() calls:

     function createCharts() {
         console.log(1);
         // some of your code here
         console.log(2);
         // some more of your code here
         console.log(3);
         // and some more of your code here
         console.log(4);
     }

 By watching the Firebug console, you will then be able to see which of your
 console.log() calls were actually executed.

 -Mike



  From: evanbu...@gmail.com

  This is probably more of a basic javascript question than a
  specific jquery function.  I have this jQuery function named
  validateSubmit() which calls two other regular javascript
  functions.  When using IE, both createCharts() and
  getDirectorIDs get called but when using FireFox, only
  createCharts() gets called and never makes it to
  getDirectorIDs() and I'm not sure why this occurs.  Thanks

  script type=text/javascript
  // make sure at least one checkbox is checked function
  validateSubmit() {
          if( $(input:checkbox:checked).length == 0 ) {
            alert( Please select at least one section for your
  PDF profile );
            return false;
          } else {
              createCharts();

               getDirectorIDs();
           return true;
          }
     }
  /script- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Calling other functions inside a function

2009-07-22 Thread Michael Lawson

Maybe you should pull the definition of the function out of the document
ready definition?

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'


   
  From:   evanbu...@gmail.com evanbu...@gmail.com  
   
  To: jQuery (English) jquery-en@googlegroups.com  
   
  Date:   07/22/2009 11:21 AM  
   
  Subject:[jQuery] Re: Calling other functions inside a function   
   






Thank you. The Firebug suggestion was helpful.  The error message is
saying that getDirectorIds() is not defined.

script type=text/javascript
// make sure at least one checkbox is checked
function validateSubmit() {
if( $(input:checkbox:checked).length == 0 ) {
 alert( Please select at least one section for your PDF profile );
 return false;
 } else {
 createCharts();

 // error occurs here
 getDirectorIDs();
 return true;
 }
 }
/script

This is the getDirectorIDs() function:

script language=javascript type=text/javascript
 // this gets all of the director id_individual values
 $(document).ready(function getDirectorIDs() {
 var result = ;
 $(.chkDirector:checked).each(function() {
 result = result + $(this).val() + ,;
 });
 // place the selected id_individual values in the label control
lblCheckedDirectors2
 document.getElementById('lblCheckedDirs').value = result;

 alert(cool);
 });
/script

On Jul 21, 7:28 pm, Michael Geary m...@mg.to wrote:
 The reason this would happen is that you have a fatal error somewhere
inside
 your createCharts() function. When this error occurs, it stops all
 JavaScript execution for the current event.

 Do you have any debugging tools such as Firebug? If not, install Firebug
and
 try again. Open the Firebug panel and make sure it's enabled for your
site,
 then reload the page and do whatever you need to do to trigger the error.

 It's very likely that Firebug will give you an error message showing
exactly
 what the problem is.

 If the problem isn't clear from that message (or if you don't get one),
try
 sprinkling the code inside createCharts() with console.log() calls:

     function createCharts() {
         console.log(1);
         // some of your code here
         console.log(2);
         // some more of your code here
         console.log(3);
         // and some more of your code here
         console.log(4);
     }

 By watching the Firebug console, you will then be able to see which of
your
 console.log() calls were actually executed.

 -Mike



  From: evanbu...@gmail.com

  This is probably more of a basic javascript question than a
  specific jquery function.  I have this jQuery function named
  validateSubmit() which calls two other regular javascript
  functions.  When using IE, both createCharts() and
  getDirectorIDs get called but when using FireFox, only
  createCharts() gets called and never makes it to
  getDirectorIDs() and I'm not sure why this occurs.  Thanks

  script type=text/javascript
  // make sure at least one checkbox is checked function
  validateSubmit() {
          if( $(input:checkbox:checked).length == 0 ) {
            alert( Please select at least one section for your
  PDF profile );
            return false;
          } else {
              createCharts();

               getDirectorIDs();
           return true;
          }
     }
  /script- Hide quoted text -

 - Show quoted text -

inline: graycol.gifinline: ecblank.gif

[jQuery] Re: Calling other functions inside a function

2009-07-22 Thread evanbu...@gmail.com

Is this the right way to do it ?

script language=javascript type=text/javascript
// this gets all of the director id_individual values
  $(document).ready(function() {
function getDirectorIds() {
var result = ;
$(.chkDirector:checked).each(function() {
result = result + $(this).val() + ,;
});
// place the selected id_individual values in the label
control lblCheckedDirectors2
document.getElementById('lblCheckedDirs').value =
result;
}
});
   /script



On Jul 22, 11:34 am, Michael Lawson mjlaw...@us.ibm.com wrote:
 Maybe you should pull the definition of the function out of the document
 ready definition?

 cheers

 Michael Lawson
 Development Lead, Global Solutions, ibm.com
 Phone:  1-276-206-8393
 E-mail:  mjlaw...@us.ibm.com

 'Whether one believes in a religion or not,
 and whether one believes in rebirth or not,
 there isn't anyone who doesn't appreciate kindness and compassion..'

   From:       evanbu...@gmail.com evanbu...@gmail.com                     
                                                  

   To:         jQuery (English) jquery-en@googlegroups.com                 
                                                  

   Date:       07/22/2009 11:21 AM                                             
                                                  

   Subject:    [jQuery] Re: Calling other functions inside a function          
                                                 

 Thank you. The Firebug suggestion was helpful.  The error message is
 saying that getDirectorIds() is not defined.

 script type=text/javascript
 // make sure at least one checkbox is checked
 function validateSubmit() {
 if( $(input:checkbox:checked).length == 0 ) {
  alert( Please select at least one section for your PDF profile );
  return false;
  } else {
  createCharts();

  // error occurs here
  getDirectorIDs();
  return true;
  }
  }
 /script

 This is the getDirectorIDs() function:

 script language=javascript type=text/javascript
  // this gets all of the director id_individual values
  $(document).ready(function getDirectorIDs() {
  var result = ;
  $(.chkDirector:checked).each(function() {
  result = result + $(this).val() + ,;
  });
  // place the selected id_individual values in the label control
 lblCheckedDirectors2
  document.getElementById('lblCheckedDirs').value = result;

  alert(cool);
  });
 /script

 On Jul 21, 7:28 pm, Michael Geary m...@mg.to wrote:



  The reason this would happen is that you have a fatal error somewhere
 inside
  your createCharts() function. When this error occurs, it stops all
  JavaScript execution for the current event.

  Do you have any debugging tools such as Firebug? If not, install Firebug
 and
  try again. Open the Firebug panel and make sure it's enabled for your
 site,
  then reload the page and do whatever you need to do to trigger the error.

  It's very likely that Firebug will give you an error message showing
 exactly
  what the problem is.

  If the problem isn't clear from that message (or if you don't get one),
 try
  sprinkling the code inside createCharts() with console.log() calls:

      function createCharts() {
          console.log(1);
          // some of your code here
          console.log(2);
          // some more of your code here
          console.log(3);
          // and some more of your code here
          console.log(4);
      }

  By watching the Firebug console, you will then be able to see which of
 your
  console.log() calls were actually executed.

  -Mike

   From: evanbu...@gmail.com

   This is probably more of a basic javascript question than a
   specific jquery function.  I have this jQuery function named
   validateSubmit() which calls two other regular javascript
   functions.  When using IE, both createCharts() and
   getDirectorIDs get called but when using FireFox, only
   createCharts() gets called and never makes it to
   getDirectorIDs() and I'm not sure why this occurs.  Thanks

   script type=text/javascript
   // make sure at least one checkbox is checked function
   validateSubmit() {
           if( $(input:checkbox:checked).length == 0 ) {
             alert( Please select at least one section for your
   PDF profile );
             return false;
           } else {
               createCharts();

                getDirectorIDs();
            return true;
           }
      }
   /script- Hide quoted text -

  - Show quoted text -



  graycol.gif
  1KViewDownload

  ecblank.gif
  1KViewDownload- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Calling other functions inside a function

2009-07-22 Thread Michael Lawson

No, i was thinking something like this

script language=javascript type=text/javascript
function getDirectorIds() {
var result = ;
$(.chkDirector:checked).each(function() {
result = result + $(this).val() + ,;
});
// place the selected id_individual values in the label
control lblCheckedDirectors2
document.getElementById('lblCheckedDirs').value =
result;
}



// this gets all of the director id_individual values
  $(document).ready(function() {
  getDirectoryIds();
});
   /script


Typically, you use $(document).ready(function(){...}); to run a function
after the document is finished loading, when its ready.  Not to actually
define the function :)

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'


   
  From:   evanbu...@gmail.com evanbu...@gmail.com  
   
  To: jQuery (English) jquery-en@googlegroups.com  
   
  Date:   07/22/2009 02:18 PM  
   
  Subject:[jQuery] Re: Calling other functions inside a function   
   






Is this the right way to do it ?

script language=javascript type=text/javascript
// this gets all of the director id_individual values
  $(document).ready(function() {
function getDirectorIds() {
var result = ;
$(.chkDirector:checked).each(function() {
result = result + $(this).val() + ,;
});
// place the selected id_individual values in the label
control lblCheckedDirectors2
document.getElementById('lblCheckedDirs').value =
result;
}
});
   /script



On Jul 22, 11:34 am, Michael Lawson mjlaw...@us.ibm.com wrote:
 Maybe you should pull the definition of the function out of the document
 ready definition?

 cheers

 Michael Lawson
 Development Lead, Global Solutions, ibm.com
 Phone:  1-276-206-8393
 E-mail:  mjlaw...@us.ibm.com

 'Whether one believes in a religion or not,
 and whether one believes in rebirth or not,
 there isn't anyone who doesn't appreciate kindness and compassion..'

   From:       evanbu...@gmail.com evanbu...@gmail.com


   To:         jQuery (English) jquery-en@googlegroups.com


   Date:       07/22/2009 11:21 AM


   Subject:    [jQuery] Re: Calling other functions inside a function


 Thank you. The Firebug suggestion was helpful.  The error message is
 saying that getDirectorIds() is not defined.

 script type=text/javascript
 // make sure at least one checkbox is checked
 function validateSubmit() {
 if( $(input:checkbox:checked).length == 0 ) {
  alert( Please select at least one section for your PDF profile );
  return false;
  } else {
  createCharts();

  // error occurs here
  getDirectorIDs();
  return true;
  }
  }
 /script

 This is the getDirectorIDs() function:

 script language=javascript type=text/javascript
  // this gets all of the director id_individual values
  $(document).ready(function getDirectorIDs() {
  var result = ;
  $(.chkDirector:checked).each(function() {
  result = result + $(this).val() + ,;
  });
  // place the selected id_individual values in the label control
 lblCheckedDirectors2
  document.getElementById('lblCheckedDirs').value = result;

  alert(cool);
  });
 /script

 On Jul 21, 7:28 pm, Michael Geary m...@mg.to wrote:



  The reason this would happen is that you have a fatal error somewhere
 inside
  your createCharts() function. When this error occurs, it stops all
  JavaScript execution for the current event.

  Do you have any debugging tools such as Firebug? If not, install
Firebug
 and
  try again. Open the Firebug panel and make sure it's enabled for your
 site,
  then reload the page and do whatever you need to do to trigger the
error.

  It's very likely that Firebug will give you an error message showing
 exactly
  what the problem is.

  If the problem isn't clear from that message (or if you don't get one),
 try
  sprinkling the code inside createCharts() with console.log() calls:

      function createCharts() {
          console.log(1);
          // some of your code here
          console.log(2);
          // some more of your code here
          console.log(3);
          // and some more of your code here
          console.log(4);
      }

  By watching the Firebug console, you will then be able to see which of
 your
  console.log() calls were actually executed.

  -Mike

   From: evanbu...@gmail.com

[jQuery] Re: Calling other functions inside a function

2009-07-22 Thread evanbu...@gmail.com

Thanks.  I've been looking for an example of this for a long time.

On Jul 22, 2:33 pm, Michael Lawson mjlaw...@us.ibm.com wrote:
 No, i was thinking something like this

 script language=javascript type=text/javascript
 function getDirectorIds() {
         var result = ;
         $(.chkDirector:checked).each(function() {
             result = result + $(this).val() + ,;
         });
         // place the selected id_individual values in the label
 control lblCheckedDirectors2
         document.getElementById('lblCheckedDirs').value =
 result;
         }

     // this gets all of the director id_individual values
       $(document).ready(function() {
       getDirectoryIds();
     });
    /script

 Typically, you use $(document).ready(function(){...}); to run a function
 after the document is finished loading, when its ready.  Not to actually
 define the function :)

 cheers

 Michael Lawson
 Development Lead, Global Solutions, ibm.com
 Phone:  1-276-206-8393
 E-mail:  mjlaw...@us.ibm.com

 'Whether one believes in a religion or not,
 and whether one believes in rebirth or not,
 there isn't anyone who doesn't appreciate kindness and compassion..'

   From:       evanbu...@gmail.com evanbu...@gmail.com                     
                                                  

   To:         jQuery (English) jquery-en@googlegroups.com                 
                                                  

   Date:       07/22/2009 02:18 PM                                             
                                                  

   Subject:    [jQuery] Re: Calling other functions inside a function          
                                                 

 Is this the right way to do it ?

 script language=javascript type=text/javascript
     // this gets all of the director id_individual values
       $(document).ready(function() {
         function getDirectorIds() {
         var result = ;
         $(.chkDirector:checked).each(function() {
             result = result + $(this).val() + ,;
         });
         // place the selected id_individual values in the label
 control lblCheckedDirectors2
         document.getElementById('lblCheckedDirs').value =
 result;
         }
     });
    /script

 On Jul 22, 11:34 am, Michael Lawson mjlaw...@us.ibm.com wrote:





  Maybe you should pull the definition of the function out of the document
  ready definition?

  cheers

  Michael Lawson
  Development Lead, Global Solutions, ibm.com
  Phone:  1-276-206-8393
  E-mail:  mjlaw...@us.ibm.com

  'Whether one believes in a religion or not,
  and whether one believes in rebirth or not,
  there isn't anyone who doesn't appreciate kindness and compassion..'

    From:       evanbu...@gmail.com evanbu...@gmail.com

    To:         jQuery (English) jquery-en@googlegroups.com

    Date:       07/22/2009 11:21 AM

    Subject:    [jQuery] Re: Calling other functions inside a function

  Thank you. The Firebug suggestion was helpful.  The error message is
  saying that getDirectorIds() is not defined.

  script type=text/javascript
  // make sure at least one checkbox is checked
  function validateSubmit() {
  if( $(input:checkbox:checked).length == 0 ) {
   alert( Please select at least one section for your PDF profile );
   return false;
   } else {
   createCharts();

   // error occurs here
   getDirectorIDs();
   return true;
   }
   }
  /script

  This is the getDirectorIDs() function:

  script language=javascript type=text/javascript
   // this gets all of the director id_individual values
   $(document).ready(function getDirectorIDs() {
   var result = ;
   $(.chkDirector:checked).each(function() {
   result = result + $(this).val() + ,;
   });
   // place the selected id_individual values in the label control
  lblCheckedDirectors2
   document.getElementById('lblCheckedDirs').value = result;

   alert(cool);
   });
  /script

  On Jul 21, 7:28 pm, Michael Geary m...@mg.to wrote:

   The reason this would happen is that you have a fatal error somewhere
  inside
   your createCharts() function. When this error occurs, it stops all
   JavaScript execution for the current event.

   Do you have any debugging tools such as Firebug? If not, install
 Firebug
  and
   try again. Open the Firebug panel and make sure it's enabled for your
  site,
   then reload the page and do whatever you need to do to trigger the
 error.

   It's very likely that Firebug will give you an error message showing
  exactly
   what the problem is.

   If the problem isn't clear from that message (or if you don't get one),
  try
   sprinkling the code inside createCharts() with console.log() calls:

       function createCharts() {
           console.log(1);
           // some of your code here
           console.log(2);
           // some more of your code here
           console.log(3);
           // and some more of your code here
           console.log(4);
       }

   By watching the Firebug console, you will then be able to see which

[jQuery] Re: Calling other functions inside a function

2009-07-22 Thread Michael Lawson

Np, let me know if that works for you!

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'


   
  From:   evanbu...@gmail.com evanbu...@gmail.com  
   
  To: jQuery (English) jquery-en@googlegroups.com  
   
  Date:   07/22/2009 02:48 PM  
   
  Subject:[jQuery] Re: Calling other functions inside a function   
   






Thanks.  I've been looking for an example of this for a long time.

On Jul 22, 2:33 pm, Michael Lawson mjlaw...@us.ibm.com wrote:
 No, i was thinking something like this

 script language=javascript type=text/javascript
 function getDirectorIds() {
         var result = ;
         $(.chkDirector:checked).each(function() {
             result = result + $(this).val() + ,;
         });
         // place the selected id_individual values in the label
 control lblCheckedDirectors2
         document.getElementById('lblCheckedDirs').value =
 result;
         }

     // this gets all of the director id_individual values
       $(document).ready(function() {
       getDirectoryIds();
     });
    /script

 Typically, you use $(document).ready(function(){...}); to run a function
 after the document is finished loading, when its ready.  Not to actually
 define the function :)

 cheers

 Michael Lawson
 Development Lead, Global Solutions, ibm.com
 Phone:  1-276-206-8393
 E-mail:  mjlaw...@us.ibm.com

 'Whether one believes in a religion or not,
 and whether one believes in rebirth or not,
 there isn't anyone who doesn't appreciate kindness and compassion..'

   From:       evanbu...@gmail.com evanbu...@gmail.com


   To:         jQuery (English) jquery-en@googlegroups.com


   Date:       07/22/2009 02:18 PM


   Subject:    [jQuery] Re: Calling other functions inside a function


 Is this the right way to do it ?

 script language=javascript type=text/javascript
     // this gets all of the director id_individual values
       $(document).ready(function() {
         function getDirectorIds() {
         var result = ;
         $(.chkDirector:checked).each(function() {
             result = result + $(this).val() + ,;
         });
         // place the selected id_individual values in the label
 control lblCheckedDirectors2
         document.getElementById('lblCheckedDirs').value =
 result;
         }
     });
    /script

 On Jul 22, 11:34 am, Michael Lawson mjlaw...@us.ibm.com wrote:





  Maybe you should pull the definition of the function out of the
document
  ready definition?

  cheers

  Michael Lawson
  Development Lead, Global Solutions, ibm.com
  Phone:  1-276-206-8393
  E-mail:  mjlaw...@us.ibm.com

  'Whether one believes in a religion or not,
  and whether one believes in rebirth or not,
  there isn't anyone who doesn't appreciate kindness and compassion..'

    From:       evanbu...@gmail.com evanbu...@gmail.com

    To:         jQuery (English) jquery-en@googlegroups.com

    Date:       07/22/2009 11:21 AM

    Subject:    [jQuery] Re: Calling other functions inside a function

  Thank you. The Firebug suggestion was helpful.  The error message is
  saying that getDirectorIds() is not defined.

  script type=text/javascript
  // make sure at least one checkbox is checked
  function validateSubmit() {
  if( $(input:checkbox:checked).length == 0 ) {
   alert( Please select at least one section for your PDF profile );
   return false;
   } else {
   createCharts();

   // error occurs here
   getDirectorIDs();
   return true;
   }
   }
  /script

  This is the getDirectorIDs() function:

  script language=javascript type=text/javascript
   // this gets all of the director id_individual values
   $(document).ready(function getDirectorIDs() {
   var result = ;
   $(.chkDirector:checked).each(function() {
   result = result + $(this).val() + ,;
   });
   // place the selected id_individual values in the label control
  lblCheckedDirectors2
   document.getElementById('lblCheckedDirs').value = result;

   alert(cool);
   });
  /script

  On Jul 21, 7:28 pm, Michael Geary m...@mg.to wrote:

   The reason this would happen is that you have a fatal error somewhere
  inside
   your createCharts() function. When this error occurs, it stops all
   JavaScript execution for the current event.

   Do you have any debugging tools such as Firebug? If not, install
 Firebug
  and
   try again. Open the Firebug panel and make sure it's enabled for your
  site

[jQuery] Re: Calling other functions inside a function

2009-07-22 Thread evanbu...@gmail.com

Yes, it does.  Thanks.

On Jul 22, 2:49 pm, Michael Lawson mjlaw...@us.ibm.com wrote:
 Np, let me know if that works for you!

 cheers

 Michael Lawson
 Development Lead, Global Solutions, ibm.com
 Phone:  1-276-206-8393
 E-mail:  mjlaw...@us.ibm.com

 'Whether one believes in a religion or not,
 and whether one believes in rebirth or not,
 there isn't anyone who doesn't appreciate kindness and compassion..'

   From:       evanbu...@gmail.com evanbu...@gmail.com                     
                                                  

   To:         jQuery (English) jquery-en@googlegroups.com                 
                                                  

   Date:       07/22/2009 02:48 PM                                             
                                                  

   Subject:    [jQuery] Re: Calling other functions inside a function          
                                                 

 Thanks.  I've been looking for an example of this for a long time.

 On Jul 22, 2:33 pm, Michael Lawson mjlaw...@us.ibm.com wrote:





  No, i was thinking something like this

  script language=javascript type=text/javascript
  function getDirectorIds() {
          var result = ;
          $(.chkDirector:checked).each(function() {
              result = result + $(this).val() + ,;
          });
          // place the selected id_individual values in the label
  control lblCheckedDirectors2
          document.getElementById('lblCheckedDirs').value =
  result;
          }

      // this gets all of the director id_individual values
        $(document).ready(function() {
        getDirectoryIds();
      });
     /script

  Typically, you use $(document).ready(function(){...}); to run a function
  after the document is finished loading, when its ready.  Not to actually
  define the function :)

  cheers

  Michael Lawson
  Development Lead, Global Solutions, ibm.com
  Phone:  1-276-206-8393
  E-mail:  mjlaw...@us.ibm.com

  'Whether one believes in a religion or not,
  and whether one believes in rebirth or not,
  there isn't anyone who doesn't appreciate kindness and compassion..'

    From:       evanbu...@gmail.com evanbu...@gmail.com

    To:         jQuery (English) jquery-en@googlegroups.com

    Date:       07/22/2009 02:18 PM

    Subject:    [jQuery] Re: Calling other functions inside a function

  Is this the right way to do it ?

  script language=javascript type=text/javascript
      // this gets all of the director id_individual values
        $(document).ready(function() {
          function getDirectorIds() {
          var result = ;
          $(.chkDirector:checked).each(function() {
              result = result + $(this).val() + ,;
          });
          // place the selected id_individual values in the label
  control lblCheckedDirectors2
          document.getElementById('lblCheckedDirs').value =
  result;
          }
      });
     /script

  On Jul 22, 11:34 am, Michael Lawson mjlaw...@us.ibm.com wrote:

   Maybe you should pull the definition of the function out of the
 document
   ready definition?

   cheers

   Michael Lawson
   Development Lead, Global Solutions, ibm.com
   Phone:  1-276-206-8393
   E-mail:  mjlaw...@us.ibm.com

   'Whether one believes in a religion or not,
   and whether one believes in rebirth or not,
   there isn't anyone who doesn't appreciate kindness and compassion..'

     From:       evanbu...@gmail.com evanbu...@gmail.com

     To:         jQuery (English) jquery-en@googlegroups.com

     Date:       07/22/2009 11:21 AM

     Subject:    [jQuery] Re: Calling other functions inside a function

   Thank you. The Firebug suggestion was helpful.  The error message is
   saying that getDirectorIds() is not defined.

   script type=text/javascript
   // make sure at least one checkbox is checked
   function validateSubmit() {
   if( $(input:checkbox:checked).length == 0 ) {
    alert( Please select at least one section for your PDF profile );
    return false;
    } else {
    createCharts();

    // error occurs here
    getDirectorIDs();
    return true;
    }
    }
   /script

   This is the getDirectorIDs() function:

   script language=javascript type=text/javascript
    // this gets all of the director id_individual values
    $(document).ready(function getDirectorIDs() {
    var result = ;
    $(.chkDirector:checked).each(function() {
    result = result + $(this).val() + ,;
    });
    // place the selected id_individual values in the label control
   lblCheckedDirectors2
    document.getElementById('lblCheckedDirs').value = result;

    alert(cool);
    });
   /script

   On Jul 21, 7:28 pm, Michael Geary m...@mg.to wrote:

The reason this would happen is that you have a fatal error somewhere
   inside
your createCharts() function. When this error occurs, it stops all
JavaScript execution for the current event.

Do you have any debugging tools such as Firebug? If not, install
  Firebug
   and
try again. Open

[jQuery] Re: Calling other functions inside a function

2009-07-21 Thread Glazz

Hi,

Can you please post the function that is not working in Firefox
please?

Regards

On 21 Jul, 19:48, evanbu...@gmail.com evanbu...@gmail.com wrote:
 This is probably more of a basic javascript question than a specific
 jquery function.  I have this jQuery function named validateSubmit()
 which calls two other regular javascript functions.  When using IE,
 both createCharts() and getDirectorIDs get called but when using
 FireFox, only createCharts() gets called and never makes it to
 getDirectorIDs() and I'm not sure why this occurs.  Thanks

 script type=text/javascript
 // make sure at least one checkbox is checked
 function validateSubmit() {
         if( $(input:checkbox:checked).length == 0 ) {
           alert( Please select at least one section for your PDF
 profile );
           return false;
         } else {
             createCharts();

              getDirectorIDs();
          return true;
         }
    }
 /script


[jQuery] Re: Calling other functions inside a function

2009-07-21 Thread Glazz

And btw... there's any return false in createCharts(); ?

On 21 Jul, 19:53, Glazz brunofgas...@live.com.pt wrote:
 Hi,

 Can you please post the function that is not working in Firefox
 please?

 Regards

 On 21 Jul, 19:48, evanbu...@gmail.com evanbu...@gmail.com wrote:

  This is probably more of a basic javascript question than a specific
  jquery function.  I have this jQuery function named validateSubmit()
  which calls two other regular javascript functions.  When using IE,
  both createCharts() and getDirectorIDs get called but when using
  FireFox, only createCharts() gets called and never makes it to
  getDirectorIDs() and I'm not sure why this occurs.  Thanks

  script type=text/javascript
  // make sure at least one checkbox is checked
  function validateSubmit() {
          if( $(input:checkbox:checked).length == 0 ) {
            alert( Please select at least one section for your PDF
  profile );
            return false;
          } else {
              createCharts();

               getDirectorIDs();
           return true;
          }
     }
  /script




[jQuery] Re: Calling other functions inside a function

2009-07-21 Thread evanbu...@gmail.com

I was hesitant to post this because it's a lot of code but here it is

script language=javascript type=text/javascript

function GetXmlHttpObject()
{
  var objXMLHttp=null

  try {
objXMLHttp = new ActiveXObject(Msxml2.XMLHTTP); //later IE
  } catch (e) {
  try {
objXMLHttp = new ActiveXObject(Microsoft.XMLHTTP); //earlier IE
  } catch (e) {
  objXMLHttp = null;
  }
}

  if (objXMLHttp==null)
  {
objXMLHttp=new XMLHttpRequest() //IE7, Firefox, Safari
  }
  return objXMLHttp
}

function stateChangedCharts()
{
  if (xmlHttp.readyState==4 || xmlHttp.readyState==complete)
 {
 createInterlocksGraph(%=intid_company%)
 }
}


function createCharts()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert (Your browser does not support the XMLHttpRequest object.)
return
}

var url=/charts/CMChart_BA_static.php?CompID=%=intid_company
%CEOTotSumComp=%=intCEOTotSumComp%
xmlHttp.onreadystatechange=stateChangedCharts
xmlHttp.open(GET,url,true)
xmlHttp.send(null)
}


function createInterlocksGraph(id_company)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert (Your browser does not support the XMLHttpRequest object.)
return
}

var url=/charts/interlocks_BA.php?type=coID=+id_company
xmlHttp.onreadystatechange=stateChangedInterlocks
xmlHttp.open(GET,url,true)
xmlHttp.send(null)
}

/script

On Jul 21, 2:55 pm, Glazz brunofgas...@live.com.pt wrote:
 And btw... there's any return false in createCharts(); ?

 On 21 Jul, 19:53, Glazz brunofgas...@live.com.pt wrote:



  Hi,

  Can you please post the function that is not working in Firefox
  please?

  Regards

  On 21 Jul, 19:48, evanbu...@gmail.com evanbu...@gmail.com wrote:

   This is probably more of a basic javascript question than a specific
   jquery function.  I have this jQuery function named validateSubmit()
   which calls two other regular javascript functions.  When using IE,
   both createCharts() and getDirectorIDs get called but when using
   FireFox, only createCharts() gets called and never makes it to
   getDirectorIDs() and I'm not sure why this occurs.  Thanks

   script type=text/javascript
   // make sure at least one checkbox is checked
   function validateSubmit() {
           if( $(input:checkbox:checked).length == 0 ) {
             alert( Please select at least one section for your PDF
   profile );
             return false;
           } else {
               createCharts();

                getDirectorIDs();
            return true;
           }
      }
   /script- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Calling other functions inside a function

2009-07-21 Thread Glazz

H at first i dont see anything wrong, i see one thing, but if ie
doesn't complain lol, close each line with ; maybe that works, but hey
i'm just gessing, ie doesn't show any problem because of that lol

Try putting alerts to verify if they show up

On 21 Jul, 20:07, evanbu...@gmail.com evanbu...@gmail.com wrote:
 I was hesitant to post this because it's a lot of code but here it is

 script language=javascript type=text/javascript

 function GetXmlHttpObject()
 {
   var objXMLHttp=null

   try {
     objXMLHttp = new ActiveXObject(Msxml2.XMLHTTP); //later IE
   } catch (e) {
   try {
     objXMLHttp = new ActiveXObject(Microsoft.XMLHTTP); //earlier IE
   } catch (e) {
   objXMLHttp = null;
   }

 }

   if (objXMLHttp==null)
   {
     objXMLHttp=new XMLHttpRequest() //IE7, Firefox, Safari
   }
   return objXMLHttp

 }

 function stateChangedCharts()
 {
   if (xmlHttp.readyState==4 || xmlHttp.readyState==complete)
  {
          createInterlocksGraph(%=intid_company%)
  }

 }

 function createCharts()
 {
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
 {
 alert (Your browser does not support the XMLHttpRequest object.)
 return

 }

 var url=/charts/CMChart_BA_static.php?CompID=%=intid_company
 %CEOTotSumComp=%=intCEOTotSumComp%
 xmlHttp.onreadystatechange=stateChangedCharts
 xmlHttp.open(GET,url,true)
 xmlHttp.send(null)

 }

 function createInterlocksGraph(id_company)
 {
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
 {
 alert (Your browser does not support the XMLHttpRequest object.)
 return

 }

 var url=/charts/interlocks_BA.php?type=coID=+id_company
 xmlHttp.onreadystatechange=stateChangedInterlocks
 xmlHttp.open(GET,url,true)
 xmlHttp.send(null)

 }

 /script

 On Jul 21, 2:55 pm, Glazz brunofgas...@live.com.pt wrote:

  And btw... there's any return false in createCharts(); ?

  On 21 Jul, 19:53, Glazz brunofgas...@live.com.pt wrote:

   Hi,

   Can you please post the function that is not working in Firefox
   please?

   Regards

   On 21 Jul, 19:48, evanbu...@gmail.com evanbu...@gmail.com wrote:

This is probably more of a basic javascript question than a specific
jquery function.  I have this jQuery function named validateSubmit()
which calls two other regular javascript functions.  When using IE,
both createCharts() and getDirectorIDs get called but when using
FireFox, only createCharts() gets called and never makes it to
getDirectorIDs() and I'm not sure why this occurs.  Thanks

script type=text/javascript
// make sure at least one checkbox is checked
function validateSubmit() {
        if( $(input:checkbox:checked).length == 0 ) {
          alert( Please select at least one section for your PDF
profile );
          return false;
        } else {
            createCharts();

             getDirectorIDs();
         return true;
        }
   }
/script- Hide quoted text -

  - Show quoted text -




[jQuery] Re: Calling other functions inside a function

2009-07-21 Thread Michael Geary

The reason this would happen is that you have a fatal error somewhere inside
your createCharts() function. When this error occurs, it stops all
JavaScript execution for the current event.

Do you have any debugging tools such as Firebug? If not, install Firebug and
try again. Open the Firebug panel and make sure it's enabled for your site,
then reload the page and do whatever you need to do to trigger the error.

It's very likely that Firebug will give you an error message showing exactly
what the problem is.

If the problem isn't clear from that message (or if you don't get one), try
sprinkling the code inside createCharts() with console.log() calls:

function createCharts() {
console.log(1);
// some of your code here
console.log(2);
// some more of your code here
console.log(3);
// and some more of your code here
console.log(4);
}

By watching the Firebug console, you will then be able to see which of your
console.log() calls were actually executed.

-Mike

 From: evanbu...@gmail.com
 
 This is probably more of a basic javascript question than a 
 specific jquery function.  I have this jQuery function named 
 validateSubmit() which calls two other regular javascript 
 functions.  When using IE, both createCharts() and 
 getDirectorIDs get called but when using FireFox, only 
 createCharts() gets called and never makes it to
 getDirectorIDs() and I'm not sure why this occurs.  Thanks
 
 script type=text/javascript
 // make sure at least one checkbox is checked function 
 validateSubmit() {
 if( $(input:checkbox:checked).length == 0 ) {
   alert( Please select at least one section for your 
 PDF profile );
   return false;
 } else {
 createCharts();
 
  getDirectorIDs();
  return true;
 }
}
 /script