Skip to content

Instantly share code, notes, and snippets.

Last active June 8, 2018 16:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
DDSlick with Gravity Forms
$('.gfield select').each(function(e) {
// Hide the select element
$(this).css('display', 'none');
// clone the select element
clone = $(this).clone();
// append the cloned select after the first select
// store the original select ID
var selectID = $(this).attr('id');
// Call ddslick on the cloned select
onSelected: function(data) {
// onSelected get the length of value of the selected option
var value = $('#' + selectID + ' .dd-selected-value').val().length;
// if the value is set (exists)
if (value > 0) {
// update the original select element with the chosen value. Fire a change to make it run condtional logic
$('select#' + selectID)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment