asp.net - :visible selector not working in Internet Explorer -


I am working on some basic form verification styles for the ASP.Net website. I have to select all the span elements that I see, and add a CSS style to another element. (Just to indicate which input fields are invalid.)

The code below works like a charm in FF and Safari, but IE fails. I have limited this problem to the bottom: the view selector here is the jQuery code

Important note:. Changes made in the product site running jQuery 1.3.1 were: Selector appearing in 1.3.2

  $ ..... ('Span.inputError: visible') each (function () {$ (this) .parent () Parent () Previous ('TD') Children ('label') Children ('span'). CSS (' Color ',' red ');});  

The HTML provided here is intended for:

  & lt; Table width = "100%" cellspacing = "0" cellpadding = "3" border = "0" & ​​gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; Td valign = "top" style = "text-line: true;" Class = "address_labels" & gt; & Lt; Label & gt; & Lt; Period & gt; * & Lt; / Span & gt; First name: & lt; / Label & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Span id = "ctl00_CMain_txtFirstName_wrapper" & gt; & Lt; Input type = "text" style = "width: 190px;" Invalidstyle = "inputError" class = "radEnabledCss input" name = "ctl00_CMain_txtFirstName_text" id = "ctl00_CMain_txtFirstName_text" size = "20" value = "zdogg" & gt; & Lt; Input type = "text" value = "zdogg" style = "border: 0pt no; margin: -18 px. 0pt 0pt; padding: 0pt; overflow: hidden; visibility: hidden; width: 1px; height: 1px ; "Name =" ctl00 $ CMain $ txtFirstName "id =" ctl00_CMain_txtFirstName "& gt; Input type = "hidden" name = "ctl00_CMain_txtFirstName_ClientState" id = "ctl00_CMain_txtFirstName_ClientState" autocomplete = "off" & gt; & Lt; / Span & gt; & Lt; Div & gt; & Lt; Span style = "color: red; display: none;" Class = "inputError" id = "ctl00_CMain_valFirstName" & gt; First name is required & lt; / Span & gt; & Lt; / Div & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;  

I put my code on: using jQuery 1.2.6, and it seems I have tested the work (I added a button to click to instantize the event) I tested using IE8 with no problems in compatibility mode.

I also tested in 1.3.2 and 1.4.2 and it works fine too.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -