Solved

input.focus in css is not working?

Posted on 2012-04-07
7
492 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generate Numbers in JQuery file 11 66
Head to not include on scroll 4 23
web project error add remove 1 27
Copying table data to one another 15 29
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…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…

809 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