Solved

input.focus in css is not working?

Posted on 2012-04-07
7
488 Views
Last Modified: 2012-08-08
Dear Team,

      I am using JSF integrated with rich faces, i.e <a4j:support event="onblur"> if we perform onblur it will fire my server side validation.

To highlight the field with the different color, i have implemented with input.focus. but it is not working in IE 6&7. so that i have implemented the same with JavaScript.in that java script code onblur is used.if i am using this java script highlighting is working fine, but my actual business validators are not working.

i tried with JQuery also, but here also validators are not firing.

So kindly help me how i can implement this with out disturbing my actual BL.
0
Comment
Question by:BhanuSVS
7 Comments
 
LVL 23

Expert Comment

by:basicinstinct
ID: 37820721
simple - don't support ie6. i refuse to in my professional and personal work.

where do the users of your website hail from? here is microsoft's breakdown of ie6 usage: http://www.ie6countdown.com/

as for ie7, it never got off the ground in the first place
0
 

Author Comment

by:BhanuSVS
ID: 37820731
Thanks basicinstinct,

thanks for your advice, but i can't say this to my customer, please try to give the proper solution.
0
 
LVL 16

Accepted Solution

by:
s8web earned 500 total points
ID: 37821343
You probably should say that to your customer, it's in their best interest.

There is no reason to develop for antiquated browsers. Where do you draw the line? In a field where technology turns over every 18 months, why support browsers that are 11 years old(IE6) and 6 years old (IE7). Browser upgrades are free, and recommended by their respective distributors. Heck, even MS doesn't support IE6 anymore, they kind of held a funeral for it.

It is important that the information contained in your website is accessible and navigable on all platforms. As far as the display bells and whistles,  I'd leave the old browsers where they belong, in the past.

If you still want to support hover in old IE's, check out csshover3.htc. Make sure you load it conditionally as its presence can mess up newer browsers (IE8 specifically).
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 9

Expert Comment

by:experts1
ID: 37821417
Could you submit an example of your JS code
which is not working?
0
 

Author Comment

by:BhanuSVS
ID: 37846318
Please find the java script code below,

<script type="text/javascript" src="/scripts/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
$(function() {
   $(".textInputField")
      .focusin(function() {
         $(this).css("background-color", "green");
      })
      .focusout(function() {
         $(this).css("background-color", "white");
      });
});
</script>

...

<input name="field1" class="textInputField">
<input name="field2" class="textInputField">
0
 
LVL 9

Expert Comment

by:experts1
ID: 37846524
Should work if you modify input fields as follows:
<input name="field1" class="textInputField" onblur="this.style.backgroundColor='green';" onfocus="this.style.backgroundColor='white';">
<input name="field2" class="textInputField" onblur="this.style.backgroundColor='green';" onfocus="this.style.backgroundColor='white';">

Open in new window

0
 

Author Closing Comment

by:BhanuSVS
ID: 38270590
thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now