Simply Program

Simply programming - It’s a life style

Archive for March, 2009...

Filed under Programming

I'm not sure why, but I always forget how to remove a border on an iframe... funny.

CODE:
  1. frameborder="0"

Comments (0) Posted by sp on Monday, March 30th, 2009

Filed under Programming, Javascript

Fantastic solution was found here:
http://www.jsnippet.com/?p=103

Comments (0) Posted by sp on Tuesday, March 24th, 2009

Filed under Programming, Javascript

I always run into this little problem - how to check all and uncheck all checkboxes no a single page. Heres a nice easy solution.

CODE:
  1. function checkAll()
  2. {
  3. if(document.getElementById('checkallbox').checked == true) // the element that you will check to check all boxes.
  4. {
  5. var checks = document.getElementsByName('CHECKBOXNAME');
  6. for(var i=0;i<checks.length;i++)
  7. {
  8. checks[i].checked = true;
  9. }
  10. }
  11. else
  12. {
  13. var checks = document.getElementsByName('CHECKBOXNAME');
  14. for(var i=0;i<checks.length;i++)
  15. {
  16. checks[i].checked = false;
  17. }
  18. }
  19. }

Enjoy!

Comments (0) Posted by sp on Saturday, March 21st, 2009