Created
March 24, 2021 19:28
-
-
Save acoyfellow/6af800904f71160d3790a3c180c97092 to your computer and use it in GitHub Desktop.
Add a textarea into PhoneSites
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
<-- place this in the Custom Code section, or in a clode block below the form --> | |
<script> | |
var form= document.querySelector('form'); | |
var submitBtn= document.getElementById('submit'); | |
var textareaWrap= document.createElement('div'); | |
textareaWrap.className= 'relative db cf'; | |
var textareaLabel= document.createElement('label'); | |
textareaLabel.innerHTML= 'Textarea Label Here'; | |
textareaWrap.appendChild(textareaLabel); | |
var textarea= document.createElement('textarea'); | |
textarea.className= 'textarea-reset ba b--black-20 fl bg-white pa3 lh-copy w-100 br2 mb2'; | |
textareaWrap.appendChild(textarea); | |
form.insertBefore(textareaWrap, submitBtn); | |
window.beforePost= function(){ | |
formData.textarea= textarea.value; | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment