1 Replies - 4504 Views - Last Post: 22 August 2012 - 02:08 AM

#1 BattlFrog  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 72
  • Joined: 09-April 12

Keep focus in textbox after using JQuery datepicker

Posted 14 August 2012 - 10:47 AM

Howdy. I have a textbox with a JQuery DatePicker attached, triggered when the user clicks in the textbox. It works great. This particular field is a birthdate field and I wrote a function to verify if the user is 18. The function works in testing. I want to fire the age verification function onblur, but after the using the datepicker, the focus is not on the textbox, so the user would actually have to select the date, then click in the field, then move out of it beofre the age verification piece will work. Obviously, this is just terrible.

The solution as I see it is to add a property or something to the end of the datepicker so it focuses on the textbox after selecting the date. I have done some research and have yet to find a solution. I will continue, but if anyone has an idea, suggestion or solution, I would love to hear it.

Thank you for reading my post.

Is This A Good Question/Topic? 0
  • +

Replies To: Keep focus in textbox after using JQuery datepicker

#2 ToshNeox  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 100
  • Joined: 10-December 11

Re: Keep focus in textbox after using JQuery datepicker

Posted 22 August 2012 - 02:08 AM

Hi,

I presume that the colourpicker has a 'finished picking' event?

You could then use the jQuery .focus() to focus on the box:

$("#picker").colourPicked(function(){
    $("#textbox").focus();
});



That should work for you - might need to check up on the colour picker documentation for the name of that function.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1