You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Is there a default way to clear a date field? Created May 13, 2010

This thread is solved

Views: 3457     Replies: 8     Last reply Dec 1, 2011  
You must login first before you can use this feature

hapasurfer

Posts: 6

Registered:
May 13, 2010

Is there a default way to clear a date field?

Posted: May 13, 2010

I have been searching and cannot find a solution to clear the date field. I am currently having to have a second link or icon that when clicked clears the date field.

Is there an easier or more space efficient method.

Thanks!

JvdMeulen

Posts: 7

Registered:
May 12, 2010

» Is there a default way to clear a date field?

Posted: May 17, 2010

Reply to: Is there a default way to clear a date field?, from hapasurfer
Try this:
$('[name=fieldname]').val('')

hapasurfer

Posts: 6

Registered:
May 13, 2010

» Is there a default way to clear a date field?

Posted: May 17, 2010

Reply to: Is there a default way to clear a date field?, from hapasurfer
Thanks for the reply. However, I was wondering if there was a way built into the interface to clear the date.

I have a field that can either be filled or left empty. If someone wants to clear the date I have to create another element outside of the dateinput plugin interface to handle that case.

If there is no other way I will continue to use the function you posted.

Thanks!

frankmichel

Posts: 4

Registered:
Sep 8, 2009

» Is there a default way to clear a date field?

Posted: May 18, 2010

Reply to: Is there a default way to clear a date field?, from hapasurfer
I agree that this would come in handy!

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1867

Registered:
Nov 16, 2007

» Is there a default way to clear a date field?

Posted: May 19, 2010

Reply to: Is there a default way to clear a date field?, from hapasurfer
I've added a possibility to clear the date value with the backspace key:

http://github.com/jquerytools/jquerytools/commit/99d14cf53ca6c6288026c8834e2ab07982c0554a

Will be released on v.1.2.2

Thanks!

frankmichel

Posts: 4

Registered:
Sep 8, 2009

» » Is there a default way to clear a date field?

Posted: May 19, 2010

Reply to: » Is there a default way to clear a date field?, from tipiirai
Cool! Talking about easy :) You're awesome! I hope it will also automatically close the dateinput dialog.

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1867

Registered:
Nov 16, 2007

» » » Is there a default way to clear a date field?

Posted: May 19, 2010

Reply to: » » Is there a default way to clear a date field?, from frankmichel
sure it does!

And this feature is out now:

http://flowplayer.org/tools/release-notes/version-1.2.x.html