Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

input.focus in css is not working?

Posted on 2012-04-07
7
Medium Priority
?
495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
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

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
A solution for Fortify Path Manipulation.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

715 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