Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if syntax 1

Status
Not open for further replies.

crabgrass

Technical User
Joined
Aug 29, 2007
Messages
111
Location
US
Can someone tell me what is the correct syntax for this command?

Thanks

if (inputs.className=="rolodex") or (inputs.name == "cmdBrowse"){
inputs.disabled = true ;
}
 
Code:
if (inputs[i].className=="rolodex" [!]||[/!] inputs[i].name == "cmdBrowse"){

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
 
[tt]if (inputs.className=="rolodex" || inputs.name == "cmdBrowse"){
inputs.disabled = true ;
}[/tt]

you really should try doing a little research yourself next time. a simple google search for "javascript or" will give you the results you need.

next time, people may be less willing to help you unless you've put some effort in yourself.

----
star.gif
 
ouch!!
Actually I did look through 2 books and asked 2 other programmers without much luck. Guess I was having trouble framing the question. And I wasn't sure if the problem was with the "or" or the reference to name.

Thanks
 
Are you kidding? the ||, &&, == and ! etc are the very basic conditions in JavaScript. It's a must for all JavaScript coders. (And many other scripting/programming lansguages.)

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Lowet, you'd be the last person I'd expect to chastise someone, with all of your excellent suggestions thus far.

----
star.gif
 
I'm sorry. I was just very surprices that he had read books of JavaScript without seeing the || etc. :P
Well, we are here to help, aren't we? ;)

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top