Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

input.focus in css is not working?

Posted on 2012-04-07
7
Medium Priority
?
497 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 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

971 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