Advertisement

06.05.2007 at 12:41PM PDT, ID: 22614723
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

Firefox, Javascript onBlur, onChange, onFocus Problems

Asked by MrBaseball9 in Firefox Web Browser, JavaScript, Dynamic HTML (DHTML)

Tags: , , , ,

OnBlur and OnFocus Events not working in FIreFox.  This is a known issue, but I've heard of some workarounds to certain situations, and I'm hoping that one of you may have the answer for my problem.

In my forms, I am combining several form fields into 1 field or storage into a database.

Example:
Dropdowns for Day, Month, Year.  I use an onBlur or onChange to call a javascript function that formats the date as 0000-00-00 and stores it to it's own variable to be stored in a database.

This method is fine in all browsers except Firefox.  Apparently, Firefox has issues with how the onblur or onchange is handled and never updates the variable, and furthermore, loses its focus to the previous text field.

I will post several examples of what I have tried.

[code]
<script language="JavaScript"><!--
function birthdayBuild() {
     document.form.birthday.value =  document.form.byear.value + '-' + document.form.bmonth.value + '-' + document.form.bday.value;
}
function hometownBuild() {
     document.form.hometown.value =  document.form.city.value + '|' + document.form.state.value + '|' + document.form.country.value;
}
function schoolBuild() {
     document.form.schools.value =  document.form.school1.value + '|' + document.form.school2.value + '|' + document.form.school3.value;
}
//--></script>

///////////////////////////////FIRST METHOD/////////////////////////////////////////////////
 <select name="bmonth" class="month" id="bmonth" onBlur="birthdayBuild();">
<option value="01">January</option>
        <option value="02">February</option>
        <option value="03">March</option>
        <option value="04">April</option>
        <option value="05">May</option>
        <option value="06">June</option>
        <option value="07">July</option>
        <option value="08">August</option>
        <option value="09">September</option>
        <option value="10">October</option>
        <option value="11">November</option>
        <option value="12">December</option>
      </select>
      <select name="bday" class="dateyear" id="bday" onBlur="birthdayBuild();">
        <?
        for ($i = 1; $i <= 31; $i++)
        {
        ?>
        <option value="<? echo $i; ?>" ><? echo $i; ?></option>
        <?
            }
       ?>
      </select>
      <select name="byear" class="dateyear" id="byear" onBlur="birthdayBuild();" >
         <?
        for ($i = 2007; $i >= 1900; $i--)
         {
        ?>
        <option value="<? echo $i; ?>" ><? echo $i; ?></option>
        <?
            }
       ?>
      </select>
        <input type="hidden" name="birthday">

///////////////////////////////SECOND METHOD/////////////////////////////////////////////////
 <input name="city" type="text" class="textfield3" id="city" onfocus="document.getElementById(city).blur()" onChange="hometownBuild();">
      <select name="state" class="dateyear" id="state" onfocus="document.getElementById(state).blur()" onChange="hometownBuild();">
    <option value="AL">AL</option>
      <option value="AK">AK</option>
      <option value="AZ">AZ</option>
      <option value="AR">AR</option>
      <option value="CA">CA</option>
</select>
      <input name="country" type="text" class="textfield3" id="country" onfocus="document.getElementById(country).blur()" onChange="hometownBuild();">
        <input type="hidden" name="hometown">

///////////////////////////////THIRD METHOD/////////////////////////////////////////////////
      <input name="city" type="text" class="textfield3" id="city" onChange="hometownBuild();" onfocus="this.blur()">
      <select name="state" class="dateyear" id="state" onChange="hometownBuild();" onfocus="this.blur()">
      <option value="AL">AL</option>
      <option value="AK">AK</option>
      <option value="AZ">AZ</option>
      <option value="AR">AR</option>
      <option value="CA">CA</option>
</select>
      <input name="country" type="text" class="textfield3" id="country" onChange="hometownBuild();" onfocus="this.blur()">
        <input type="hidden" name="hometown">
[/code]

Plug this into a firefix browser and you'll see what I mean.


Start Free Trial
 
Loading Advertisement...
 
[+][-]06.05.2007 at 01:16PM PDT, ID: 19220306

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2007 at 01:21PM PDT, ID: 19220351

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2007 at 01:26PM PDT, ID: 19220398

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2007 at 01:32PM PDT, ID: 19220468

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2007 at 01:38PM PDT, ID: 19220520

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2007 at 01:46PM PDT, ID: 19220604

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2007 at 01:48PM PDT, ID: 19220615

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2007 at 01:53PM PDT, ID: 19220666

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2007 at 02:07PM PDT, ID: 19220809

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2007 at 02:25PM PDT, ID: 19220963

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Firefox Web Browser, JavaScript, Dynamic HTML (DHTML)
Tags: firefox, javascript, onblur, onchange, onfocus
Sign Up Now!
Solution Provided By: ncoo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.06.2007 at 06:21AM PDT, ID: 19224874

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.06.2007 at 10:41AM PDT, ID: 19227061

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32