File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can you have nested if statements in jQuery?

 
Mark Warner
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a select statement if "Credit_Card" is selected then I have some form fields enabled. What I want to do is enable the field explain_other if another select statement (bank_cc_trans_type) is set to "Other". However my inner nested if statement is not working.



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jQuery doesn't change anything about how the fundamentals of JavaScript work, so how if statements work is completely orthogonal to the use of jQuery.

Can you please explain what "is not working" means? (see ItDoesntWorkIsUseless)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. Give your info so far, I would set a breakpoint at line 11 and see what the condition evaluates to.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well first thing is you want to use prop() and not attr() for setting the disabled state of the element with jQuery 1.6+.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic