Tell me more ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

Possible Duplicate:
refactor javascript - show and hide fields based on current selection

I need help refactoring the javascript. http://jsfiddle.net/BDLYP/

I was able to hide and show fields, but I know this can be improved upon.

If #state is empty, hide #high-schools and #other_high_schools

If #state is picked, show #high-schools and show #other_high_schools (if #high-schools is empty)

share|improve this question

migrated from stackoverflow.com Apr 12 '12 at 22:04

marked as duplicate by sepp2k Apr 13 '12 at 12:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 2 down vote accepted

http://jsfiddle.net/BDLYP/1/ - same result with smaller footprint and element caching, changed some ids

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.