On Oct 18, 2006, at 2:09 PM, Rey Bango wrote:
I initially tried the toggle() method but it didn't provide the correct functionality for this specific issue.

That's right; it doesn't provide functionality for onchange. 

.toggle() is for click only. 

From the API:
"Toggle between two function calls every other click. Whenever a matched element is clicked, the first specified function is fired, when clicked again, the second is fired. All subsequent clicks continue to rotate through the two functions."


stylo~ wrote:
This seems so common, is there no toggle function?

Btw, what is the best way to add little helpers like that to our own jquery?


Rey Bango-2 wrote:
  
Hey Andy, you can do something like this:

$(document).ready(function() {
	
	$( "#type" ).change( function() {
		if ( $( this ).val() == "event" )
			$("#zipCode").show();
		else
			$("#zipCode").hide();
	})		
});


	Zip Code of event
	

___________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to