Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] URGENT: Object required error in onClick event


  • From: javascript@xxxxxxxxxx (Peter Brunone)
  • Subject: [Javascript] URGENT: Object required error in onClick event
  • Date: Thu, 20 Jun 2002 10:06:27 -0500

Michael,

	Are you sure the problem isn't a misspelled form name or the fact that
you're using integers to identify objects?

-Peter

|-----Original Message-----
|From: javascript-admin@xxxxxxxxxx [mailto:javascript-admin@xxxxxxxxxx]On
|Behalf Of Michael J. Mahony
|Sent: Thursday, June 20, 2002 9:53 AM
|To: javascript@xxxxxxxxxx
|Subject: [Javascript] URGENT: Object required error in onClick event
|
|
|Hi,
|
|I'm getting frustrated by this code and thought I would ask for some
|help.
|
|I've got a simple onClick handler in my code.  However, when I click the
|item I want to fire off the onClick handler I'm told that an object is
|required.  It basically just does not see the function I've designed to
|handle the onClick event.  Here is the relevant portion of the HTML
|code:
|
|<td><input type="checkbox" value="0.99-11229" name="3168"
|onClick="clicked11229();">Add Kid's Shake<i>(add
|0.99)</i></td></tr><tr><td>&nbsp;</td><td>&nbsp;&nbsp;&nbsp;&nbsp;
|<input
|type="checkbox" value="0.00-11230" name="3169">Vanilla<i>(add
|0.00)</i></td></tr><tr><td>&nbsp;</td><td>&nbsp;&nbsp;&nbsp;&nbsp;
|<input
|type="checkbox" value="0.00-11231" name="3169">Chocolate<i>(add
|0.00)</i></td></tr><tr><td>&nbsp;</td><td>&nbsp;&nbsp;&nbsp;&nbsp;
|<input
|type="checkbox" value="0.00-11232" name="3169">Strawberry<i>(add
|0.00)</i></td>
|
|
|And here is the relevant JavaScript code:
|
|<script language="javascript 1.0">
|<!--
|
|function clicked11229()
|{
|if(document.forms.orderoptions.3168.checked!=true)
|{
|alert('Got here');
|document.forms.orderoptions.3169[0].checked=false;
|document.forms.orderoptions.3169[1].checked=false;
|document.forms.orderoptions.3169[2].checked=false;
|}
|}
|
|//-->
|</script>
|
|I've also tried modifying this as follows:
|
|<script language="javascript 1.0">
|<!--
|
|function clicked11229()
|{
|if(document.orderoptions.3168.checked!=true)
|{
|alert('Got here');
|document.orderoptions.3169[0].checked=false;
|document.orderoptions.3169[1].checked=false;
|document.orderoptions.3169[2].checked=false;
|}
|}
|
|//-->
|</script>
|
|but it still fails.
|
|What am I doing wrong?
|
|Thanks!
|_______________________________________________
|Javascript mailing list
|Javascript@xxxxxxxxxx
|https://lists.LaTech.edu/mailman/listinfo/javascript
|