close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Date Picker on its own?

Thread began 1/21/2010 5:49 pm by Andrew Read | Last modified 2/19/2010 1:50 pm by Andrew Read | 3541 views | 6 replies |

Andrew Read

Date Picker on its own?

I know that this has been asked before, and from what I understand, the "DatePicker" can not be used on its own (without a "CSS Form Builder" form.)

How hard would it be to create this as a behaviour that could be separately added to any date field? If none of your users have officially requested it, then I will.

It would be nice to use this with a DataAssist form as well, without the need for CSS FB (which seems to be breaking my DataAssist forms right now.)

Thanks,

Sign in to reply to this post

Jason ByrnesWebAssist

I am moving this to the Wish List forum so our engineers will see your request, I am also logging a feature request.

Sign in to reply to this post

Andrew Read

It's almost working!

Thanks for moving this.. I have noted the new location and will put all future feature requests here.

I actually decided to try and get datePicker to work on it's own last night. I built a fake form with the 4 date fields that I require, all setup as they are in the regular DataAssist form and used CSS Form builder on them making them all date pickers.

I then moved the required javaScripts and "datePicker" related includes into the DataAssist form. Everything seems to work -EXCEPT- that the dates are formatted incorrectly when they are put into the fields by datePicker (they are MM/DD/YYYY rather than the YYYY-MM-DD that MySql expects.)

What is required for these dates to be properly formatted before they are submitted by the query?

Thanks,

Andrew

Sign in to reply to this post

Jason ByrnesWebAssist

The date picker elements are Spry Text Fields, the format used is controlled by Spry. To edit the format, select the Date picker filed, you will see a blue bounding box appear around the text field, click this to trigger the Properties inspector to show the Spry Options, Change the format option to the one you wish to use.

Sign in to reply to this post

Andrew Read

This will allow me to change the Spry Validation used, but does not allow me to change the format that the date picker is putting into the field.

I need to change the format that the date picker is dropping into the field from MM/DD/YYYY to YYYY-MM-DD so that is submits a valid date to the MySQL database.

How is this done?

Sign in to reply to this post

Jason ByrnesWebAssist

In the insert record behavior, you can modify the binding to reformat the date as it is going into the database.



When you bind a column to a form field it will create code similar to:

php:
<?php echo((isset($_POST["date"]))?$_POST["date"]:""?>




you can change that to use the date function to reformat the date:

php:
<?php echo((isset($_POST["date"]))?date("Y-m-d"strtotime($_POST["date"]):""?>
Sign in to reply to this post

Andrew Read

Thanks Jason,

Looks like that would work, but in a post about displaying "UK dates" I discovered that you can just enter the correct date into the field in the first place by adding -- dateFormat: 'yy-mm-dd', -- after the -- changeYear: true -- line:

changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd',



It is possible that a combination of this and your rewrite would solve the UK date problem in that post.. might want to take a look a that post and see if they ever solved the issue.

It would probably be a good idea if the DataAssist just made any date fields format themselves properly automatically, so that he users don't have to go in and edit the code. Would it not?

Thanks,

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...