|
-
Nov 29th, 2001, 10:09 AM
#1
Thread Starter
Evil Genius
syntax error ?
Code:
if (document.forms.item("hidGamChosen") != "") _
AND (document.forms.item("hidGamChosen") != null) {
Can anyone tell me if I've written that one right?
(I haven't got the _ in the actual code), Thanks.
Last edited by alex_read; Nov 29th, 2001 at 10:35 AM.
-
Nov 29th, 2001, 01:11 PM
#2
Frenzied Member
First, familiarize yourself with the DOM specs from the W3C.
Second, do you have a form named "forms"?
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Nov 29th, 2001, 06:28 PM
#3
Fanatic Member
Instead of "AND", use "&&".
Alcohol & calculus don't mix.
Never drink & derive.
-
Nov 30th, 2001, 03:34 AM
#4
Thread Starter
Evil Genius
no, but the forms collection seems to work as well as if I name the form, I'll remember the && one.
Thanks for the suggestions
-
Nov 30th, 2001, 05:05 AM
#5
PowerPoster
hi
Why not simply use it this way :
Code:
if (document.formname.hidGamChosen != "") && (document.formname.hidGamChosen != null) {
-
Nov 30th, 2001, 09:30 AM
#6
Frenzied Member
Yeah, Jonny, that is what I was driving at. I don't think the item collection is part of the standard.
Wynd found the error though. That's what I get for using entirely too many languages in one day. Another reason to stop using VB: Perl, JavaScript, C++, and Java all have similar syntax.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|