Last active
August 27, 2019 17:21
-
-
Save noahub/ee480189a99aeac35d6005ce57a2aa3a to your computer and use it in GitHub Desktop.
Conversational Forms in Unbounce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.lp-pom-form, .lp-pom-form.lp-pom-button{ | |
visibility:hidden; | |
} | |
/*some sample styling*/ | |
/* .conversational-form cf-chat-response.robot text { | |
font-size: 14px; | |
} | |
.conversational-form cf-chat-response.user text { | |
font-size: 14px; | |
} | |
.conversational-form cf-chat-response.robot { | |
max-width: 85%; | |
} | |
.conversational-form cf-input input{ | |
font-size: 120%; | |
} | |
.conversational-form cf-button { | |
font-size: 14px; | |
} | |
cf-chat-response{ | |
color: #444 !important; | |
}*/ | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript" src="https://conversational-form-0iznjsw.stackpathdns.com/conversational-form.min.js" crossorigin></script> | |
<script> | |
$("name").attr("pattern", "/^$|\s+/"); | |
var formElm = document.getElementsByClassName("lp-pom-form")[0]; | |
var context = $(formElm).parent()[0]; | |
$(formElm).conversationalForm({ | |
context: context, | |
submitCallback: (e) => { | |
window.ConversationalForm.addRobotChatResponse("Awesome. Thanks for your time!"); //update with final message | |
lp.jQuery('.lp-pom-form form').submit(); | |
}, | |
robotImage: "http://unbounce.wpengine.netdna-cdn.com/photos/Unbounce-icon-light-background.png", | |
userImage: "https://commons.wikimedia.org/wiki/File%3ASolid_white.png" | |
}); | |
/** | |
* Do not remove this section; it allows our team to troubleshoot and track feature adoption. | |
* TS:0002-03-066 | |
*/ | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment