fbpx

Universal Hubspot form generator

Universal Hubspot form generator

For IVB internal use only

Tutorial video link

Additional Fields

Note: for fields with multiple inputs (radio, select, checkbox), put all values in "Value(s)" column, separated by ||. E.g. 1||2||3

Type Value(s) Label Name Placeholder Delete

Preview

Optional: script for copying the form settings from livesite:

!! advanced feature, ask webmaster for instructions on how to use.

javascript: function getAllSelectValues(select){ var output=[]; var options=select.querySelectorAll("option"); for (var i = 0; i < options.length; i++) { output.push(options[i].innerText); } return output.join("||"); } if(document.querySelector(".hs-form-iframe")){ var iframeDoc=document.querySelector(".hs-form-iframe").contentDocument; }else{ var iframeDoc=document; } var inputs=iframeDoc.querySelectorAll(".hs-input"); var inputArr={}; for (var i = 0; i < inputs.length; i++) { var name=inputs[i].getAttribute("name"); if (!inputArr[name]) { var type=inputs[i].getAttribute("type"); var value=inputs[i].value; if (inputs[i].outerHTML.indexOf("<select")>-1) {type="select";value=getAllSelectValues(inputs[i]);} if (inputs[i].outerHTML.indexOf("<textarea")>-1) {type="textarea";} var label=inputs[i].parentElement.parentElement.querySelector("label"); if(label){label=label.innerText;}else{label="";} var placeholder=inputs[i].getAttribute("placeholder"); if (!placeholder) {placeholder="";} inputArr[name]={name:name,type:type,label:label,placeholder:placeholder,defaultvalue:value}; }else{ inputArr[name]["defaultvalue"]+="||"+inputs[i].value; } } var output=[]; for(i in inputArr){ output.push(inputArr[i]); } var textareaTemp=document.createElement("textarea"); document.body.appendChild(textareaTemp); textareaTemp.value=JSON.stringify(output); textareaTemp.select(); document.execCommand("copy"); textareaTemp.outerHTML="";