Thanks @bartekkustra. Used your example and got it to “partially” work.
The example in this thread… did not work for for me.
Basically… in the above example… you place code in the custom code (head) area
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker({
altField: "#DatepickerBox2" ,
altFormat: "DD, d MM, yy"
});
});
</script>
Add an Embedded Element to the form… and use this code in the element
<div id="datepicker"></div>
And this where I got confused…
- add an input element under the Embedded element…
- and give it an ID of DatepickerBox2… thus tying it to the js script.
Part of the problem here is.… WebFlow adds a JQUERY call at the very bottom near the /BODY tag.
And the example code adds an extra JQUERY LOAD to the top. This creates a conflict.
To remove the conflict…you have to remove the non-webflow jquery call.
But then this creates an issue - in that now JQUERY-UI is called before JQUERY.
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
This is why you have to move the JQUERY-UI call to the bottom - below the JQUERY call.
Again… the above DID NOT WORK for me.
I used @bartekkustra suggestion and modified it a little.
What I came up with is this… and it works.
Custom Code: (Head) add this:
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
Custom Code: (/body)… add this:
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script>
$(document).ready(function() {
$( "#datepick-res" ).datepicker();
});
</script>
Add an Embedded Element to the form… and use this code in the element
<div id="datepicker">
<input class="w-input" id="datepick-res" type="text" placeholder="Select Date" name="field" required="required">
</div>
This creates an element that appears on the screen… which looks like the text / input element.
The ID (datepick-res") ties the element back to the js script.
You can call it anything you want… just make sure the 2 instances are the same.
You can also additional date picker fields… just give 2 instances of a different name - and of course update the necessary script / function.