Your question is better suited to the main jQuery list: http://groups.google.com/group/jquery-en
<http://groups.google.com/group/jquery-en>since it's not about jQuery UI plugins[*]. While we're here, you can use the visibility pseudo-selectors, :hidden and :visible http://docs.jquery.com/Selectors/hidden http://docs.jquery.com/Selectors/visible - Richard [*] http://rdworth.org/blog/2008/10/jquery-plugins-and-jquery-ui/ On Tue, Aug 4, 2009 at 9:17 AM, Joshua Beall <[email protected]> wrote: > > Hi All, > > I have some code that will show or hide a div based on the AJAX result > it gets back. Here's the code: > > if(responseData.valid == false && $ > ('#ConstituentID').val().length > 0){ > $('#InvalidConstituentIdWarning').show > ("blind",null,500); > } else { > $('#InvalidConstituentIdWarning').hide > ("blind",null,500); > } > > The idea is that, if they typed something in the ConstituentID box, > and validation failed, we show them a warning that the number they > typed in is wrong. Otherwise, we hide that warning. > > The problem is that if the warning is already hidden, and the "hide" > function is called, the div is shown and then immediately hidden--not > what we want. We want it to just stay hidden. > > So, how do I check to see if the "InvalidConstituentIdWarning" block > is hidden already or not? It's a div. Do I check the value of the CSS > "display" selector, with none being hidden, and block being shown? Or > is that not the "right" way to go about this? > > -Josh > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
