• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

onBlurEvent clarification

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

First of all I would like to say this is the best forum I have come across for various reasons.
one being the direction which is shown to the user to think and the suggestions to follow.

Keep it up guys!

Coming to the question.

I coded a html page in which I used onblur event to calculate a value.

Say I have a field cost1,cost2 etc. onblur of cost1 or cost2 I called a function to calculate the total cost.

I was suggested that I should use onBlur along with setTimeOut without which it would be a poor practice.

So I started my search and did not find the best practice as such to follow, I did read in some mail archives about the problems in Mozilla.

But here i would merely be calculating the total cost on blur.

So I need your valuable suggestions on this please.

In case you need a code snippet I will be happy to provide that.

Thanks
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would you think you should use setTimeout on blur to do the calculation? Seems rather strange to do that.



Eric
 
sumanth kadaba
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,

Sorry Eric, I din't ask the question right.

I only wanted a clarification.

say I have entered an invalid input I alert the user and then focused on the same text box.

I mistook the suggestion given

Is it a very poor practice to focus something in onBlur without using timeout ?

Thanks for your time Eric.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think using a timeout to refocus something after blur would be a nuisance since it will steal focus from there the user is at.

I personally think onblur forced fixing of things is a bad practice.

Eric
 
sumanth kadaba
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,

I think using a timeout to refocus something after blur would be a nuisance since it will steal focus from there the user is at.



Yes I agree with this.

I personally think onblur forced fixing of things is a bad practice.



I will keep this in mind.

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic