[How to] Add a Calendar Date Picker To Your Form



Show first post

35 replies

Userlevel 2
Badge +1

I finally got this working!
Use this:

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">

instead of this from the instructions:

<link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/smoothness/jquery-ui.css" />

Worked for me. Let me know if it works for you.

Userlevel 2
Badge +1

Try the solution I have shared above, it worked for me.

Hi Hope you are Good
I’m facing issue in style
http://unbouncepages.com/pbj-friends/



Hello,
We added this date picker to one of our forms, but we are having trouble with the market integration. We’ve mapped the date picker field to a marketo field but it is not passing the data over. We keep getting an “invalid date” error. Can someone tell me what the field type should be in Marketo so that it passes through properly (i.e. date, text, etc.)? Any help would be greatly appreciated.

  • Carlos

You may need to change the format of the date in order to make it work with Marketo. For instance, I had to modify the date produced by the calendar (MM/DD/YYYY) by replacing the “/” characters with “-” to validate the date against a javascript system date.

This was the replacement regex:
var purchaseDate = purchaseDay.replace(///g,"-");

However, if a date in another platform needs to be in the format YYYY-MM-DD, then you’d need to do a little bit more formatting to get the date to pass correctly into the other platform.

UPDATE: Just looked at Marketo’s API specifications. They need YYYY-MM-DD format.

Any advice on how to add Date & Time? Thank you!

Is there a way to allow only weekdays for app’t and exclude weekends? so 7 days out minus weekends?

Badge

Hi, 

Has anyone been able to switch the format in which the dates are given?

I.e. my client is looking to send the D.O.B through in the following format dd/mm/yyyy

 

Any help is greatly appreciated!

Thanks

Hi Cam,

I was able to find a way to change the format of the date when using the date picker. 

To do this you will want to change the script in Step 4 to what I added below:
 

<script>
$(function() {
$( "#start_date" ).datepicker();
});
$( "#start_date" ).datepicker({
dateFormat: "dd-mm-yy"
});
</script>

This is script has a small addition which would allow you to set the order of dd/mm/yy.

You will want to make sure both instances of start_date match your form field ID. 

Thanks,

René

The datepicker works great!  However, users can still type random numbers into the field and the field accepts it.

 

Does anyone know how to require that what is typed into an unbounce form field is actually a date?

Reply