Computer Help and Spyware Removal Computer Help and Spyware Removal Computer Help and Spyware Removal Computer Help Forums Windows Startup Programs Database Virus, Spyware, and Malware Removal Guides Computer Tutorials Uninstall Database File Database Computer Glossary Computer Resources
 

Welcome Guest ( Log In | Click here to Register a free account now! )



Register a free account to unlock additional features at BleepingComputer.com
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

 
Reply to this topicStart new topic
> Javascript Object Required error
Phantek
post Sep 10 2009, 05:56 PM
Post #1


Member
**

Group: Members
Posts: 91
Joined: 25-August 08
Member No.: 233,126



I am trying to teach myself JavaScript. I have tried using online tutorials, but I am not prepared for this kind of error. I am trying to have a tablerow appear when a checkbox is selected. The name of the tablerow is generated dynamically by PHP. My code is:

CODE
<head>

&lt;script type="text/javascript">
function showhide(box,id) {

    var elm = document.getElementById(id)

    elm.style.display = box.checked? "table-row":"none"
}
</script>

//Down in the body:

<insert type="checkbox" name="v1[]" value=$vname onclick="showhide(this,$vname)">


Unfortunately, I keep getting an "object required" error on the line with

CODE
elm.style.display = box.checked? "table-row":"none"


Any ideas? Thanks in advance for your help!
Go to the top of the page
 
+Quote Post
Phantek
post Sep 10 2009, 06:42 PM
Post #2


Member
**

Group: Members
Posts: 91
Joined: 25-August 08
Member No.: 233,126



Ummm, yeah... found my own mistake. I was missing single quotes around the variable name that I was passing to the function. Thanks anyways!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 21st November 2009 - 09:11 PM


Advertise   |   About Us   |   Terms of Use   |   Privacy Policy   |   Contact Us   |   Site Map   |   Chat   |   Tutorials   |   Uninstall List
Discussion Forums   |   The Computer Glossary   |   Resources   |   RSS Feeds   |   Startups   |   The File Database   |   Virus Removal Guides

© 2003-2009 All Rights Reserved Bleeping Computer LLC.