Created
October 23, 2020 02:58
-
-
Save nsulistiyawan/14eb5ee49c9c7322c238abe7aa55e863 to your computer and use it in GitHub Desktop.
example-bloomerang.js
This file contains hidden or 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 type="text/javascript" id="bloomerangForm2705410"></script> | |
<pre><script type="text/javascript"> | |
var insertForm2705410 = function() { | |
var html2705410 = '<style text=\'text/css\'>' + | |
'.interaction-form label{color: #404040;' + | |
' display: block;}' + | |
'' + | |
'.interaction-form label.error{color:#900;' + | |
' display: inline-block; ' + | |
' padding: 0 10px;}' + | |
'' + | |
'.interaction-form .field{padding: 4px 0;}' + | |
'' + | |
'.interaction-form .field .required-star{color: #aa0000; ' + | |
' display: inline-block; ' + | |
' margin-left: 5px;}' + | |
'' + | |
'.interaction-form .field .checkboxes{max-width:275px;' + | |
' border: 1px solid #A9A9A9;' + | |
' -webkit-transition: all .3s ease-out;' + | |
' -moz-transition: all .3s ease-out;' + | |
' transition: all .3s ease-out;}' + | |
'' + | |
'.interaction-form .field .checkbox{display:block;' + | |
' position:relative;' + | |
' -moz-box-sizing:border-box;' + | |
' box-sizing:border-box;' + | |
' height:30px;' + | |
' line-height:26px;' + | |
' padding:2px 28px 2px 8px;' + | |
' border-bottom:1px solid rgba(0,0,0,0.1);' + | |
' color:#404040; ' + | |
' overflow:hidden;' + | |
' text-decoration:none; }' + | |
'' + | |
'.interaction-form .field .checkbox input{opacity:0.01;' + | |
' position:absolute;' + | |
' left:-50px; ' + | |
' z-index:-5;}' + | |
'' + | |
'.interaction-form .field .checkbox:last-child{border-bottom:none;}' + | |
'' + | |
'.interaction-form .field .checkbox.selected{background: rgb(50, 142, 253);' + | |
' color:#fff; }' + | |
'' + | |
'.interaction-form .field .checkbox.selected:before{color:#fff;' + | |
' line-height:30px;' + | |
' position:absolute;' + | |
' right:10px; }' + | |
'' + | |
'.interaction-form .field.radio input,' + | |
' .interaction-form .field.checkbox input{width: auto;' + | |
' margin-left:0;}' + | |
'' + | |
'.interaction-form .section.consent .field.checkbox:not(.consent-all){margin-left: 20px;}' + | |
'' + | |
'.interaction-form .field input,' + | |
' .interaction-form .field select,' + | |
' .interaction-form .field textarea{padding: 4px; ' + | |
' max-width: 275px;' + | |
' width: 96%}' + | |
'' + | |
'.interaction-form .field textarea.international{height: 120px;}' + | |
'' + | |
'.interaction-form .errors{border: 1px solid #900;' + | |
' color: #900; ' + | |
' padding: 10px;}' + | |
'' + | |
'.interaction-form .hidden{display: none;}' + | |
'' + | |
'.btn-group .btn-submit-email{padding: 4px 10px;}' + | |
'' + | |
'input, select, textarea, button{font-family: inherit;}' + | |
'' + | |
'</style>' + | |
'' + | |
'<div id="interaction-form-container">' + | |
' <form id="interaction-form" class="interaction-form" method="post" action="javascript:void(0)">' + | |
' <div class="errors hidden"></div>' + | |
' <div class="section contact">' + | |
' <h3>Contact Information</h3>' + | |
' <div class="field text first-name required" >' + | |
'<label for="first-name"><span class="label">First Name</span><span class="required-star">*</span></label>' + | |
'<input id="first-name" name="first-name" class="required" type="text"></input>' + | |
'</div>' + | |
'<div class="field text last-name required" >' + | |
'<label for="last-name"><span class="label">Last Name</span><span class="required-star">*</span></label>' + | |
'<input id="last-name" name="last-name" class="required" type="text"></input>' + | |
'</div>' + | |
'<div class="field email email-address required" >' + | |
'<label for="email-address"><span class="label">Email</span><span class="required-star">*</span></label>' + | |
'<input id="email-address" name="email-address" class="email required" type="email" placeholder="[email protected]"></input>' + | |
'</div>' + | |
'<div class="field tel phone-number" >' + | |
'<label for="phone-number"><span class="label">Phone</span></label>' + | |
'<input id="phone-number" name="phone-number" class="phoneUS" type="tel"></input>' + | |
'</div>' + | |
'' + | |
'</div>' + | |
' <div class="section address">' + | |
' <h3>Address</h3>' + | |
' <div class="field country" >' + | |
'<label for="country">Country</label>' + | |
'<select id="country" name="country"><option value=""></option>' + | |
'<option value="AF">Afghanistan</option>' + | |
'<option value="AX">Aland Islands</option>' + | |
'<option value="AL">Albania</option>' + | |
'<option value="DZ">Algeria</option>' + | |
'<option value="AS">American Samoa</option>' + | |
'<option value="AD">Andorra</option>' + | |
'<option value="AO">Angola</option>' + | |
'<option value="AI">Anguilla</option>' + | |
'<option value="AQ">Antarctica</option>' + | |
'<option value="AG">Antigua and Barbuda</option>' + | |
'<option value="AR">Argentina</option>' + | |
'<option value="AM">Armenia</option>' + | |
'<option value="AW">Aruba</option>' + | |
'<option value="AU">Australia</option>' + | |
'<option value="AT">Austria</option>' + | |
'<option value="AZ">Azerbaijan</option>' + | |
'<option value="BS">Bahamas</option>' + | |
'<option value="BH">Bahrain</option>' + | |
'<option value="BD">Bangladesh</option>' + | |
'<option value="BB">Barbados</option>' + | |
'<option value="BY">Belarus</option>' + | |
'<option value="BE">Belgium</option>' + | |
'<option value="BZ">Belize</option>' + | |
'<option value="BJ">Benin</option>' + | |
'<option value="BM">Bermuda</option>' + | |
'<option value="BT">Bhutan</option>' + | |
'<option value="BO">Bolivia</option>' + | |
'<option value="BA">Bosnia and Herzegovina</option>' + | |
'<option value="BW">Botswana</option>' + | |
'<option value="BV">Bouvet Island</option>' + | |
'<option value="BR">Brazil</option>' + | |
'<option value="IO">British Indian Ocean Territory</option>' + | |
'<option value="BN">Brunei Darussalam</option>' + | |
'<option value="BG">Bulgaria</option>' + | |
'<option value="BF">Burkina Faso</option>' + | |
'<option value="BI">Burundi</option>' + | |
'<option value="KH">Cambodia</option>' + | |
'<option value="CM">Cameroon</option>' + | |
'<option value="CA">Canada</option>' + | |
'<option value="CV">Cape Verde</option>' + | |
'<option value="KY">Cayman Islands</option>' + | |
'<option value="CF">Central African Republic</option>' + | |
'<option value="TD">Chad</option>' + | |
'<option value="CL">Chile</option>' + | |
'<option value="CN">China</option>' + | |
'<option value="CX">Christmas Island</option>' + | |
'<option value="CC">Cocos (Keeling) Islands</option>' + | |
'<option value="CO">Colombia</option>' + | |
'<option value="KM">Comoros</option>' + | |
'<option value="CG">Congo</option>' + | |
'<option value="CD">Democratic Republic of the Congo</option>' + | |
'<option value="CK">Cook Islands</option>' + | |
'<option value="CR">Costa Rica</option>' + | |
'<option value="CI">Cote d\'Ivoire</option>' + | |
'<option value="HR">Croatia</option>' + | |
'<option value="CU">Cuba</option>' + | |
'<option value="CW">Curacao</option>' + | |
'<option value="CY">Cyprus</option>' + | |
'<option value="CZ">Czech Republic</option>' + | |
'<option value="DK">Denmark</option>' + | |
'<option value="DJ">Djibouti</option>' + | |
'<option value="DM">Dominica</option>' + | |
'<option value="DO">Dominican Republic</option>' + | |
'<option value="EC">Ecuador</option>' + | |
'<option value="EG">Egypt</option>' + | |
'<option value="SV">El Salvador</option>' + | |
'<option value="GQ">Equatorial Guinea</option>' + | |
'<option value="ER">Eritrea</option>' + | |
'<option value="EE">Estonia</option>' + | |
'<option value="SZ">Eswatini</option>' + | |
'<option value="ET">Ethiopia</option>' + | |
'<option value="FK">Falkland Islands (Malvinas)</option>' + | |
'<option value="FO">Faroe Islands</option>' + | |
'<option value="FJ">Fiji</option>' + | |
'<option value="FI">Finland</option>' + | |
'<option value="FR">France</option>' + | |
'<option value="GF">French Guiana</option>' + | |
'<option value="PF">French Polynesia</option>' + | |
'<option value="TF">French Southern Territories</option>' + | |
'<option value="GA">Gabon</option>' + | |
'<option value="GM">Gambia</option>' + | |
'<option value="GE">Georgia</option>' + | |
'<option value="DE">Germany</option>' + | |
'<option value="GH">Ghana</option>' + | |
'<option value="GI">Gibraltar</option>' + | |
'<option value="GR">Greece</option>' + | |
'<option value="GL">Greenland</option>' + | |
'<option value="GD">Grenada</option>' + | |
'<option value="GP">Guadeloupe</option>' + | |
'<option value="GU">Guam</option>' + | |
'<option value="GT">Guatemala</option>' + | |
'<option value="GG">Guernsey</option>' + | |
'<option value="GN">Guinea</option>' + | |
'<option value="GW">Guinea-Bissau</option>' + | |
'<option value="GY">Guyana</option>' + | |
'<option value="HT">Haiti</option>' + | |
'<option value="HM">Heard Island</option>' + | |
'<option value="HN">Honduras</option>' + | |
'<option value="HK">Hong Kong</option>' + | |
'<option value="HU">Hungary</option>' + | |
'<option value="IS">Iceland</option>' + | |
'<option value="IN">India</option>' + | |
'<option value="ID">Indonesia</option>' + | |
'<option value="IR">Islamic Republic of Iran</option>' + | |
'<option value="IQ">Iraq</option>' + | |
'<option value="IE">Ireland</option>' + | |
'<option value="IM">Isle of Man</option>' + | |
'<option value="IL">Israel</option>' + | |
'<option value="IT">Italy</option>' + | |
'<option value="JM">Jamaica</option>' + | |
'<option value="JP">Japan</option>' + | |
'<option value="JE">Jersey</option>' + | |
'<option value="JO">Jordan</option>' + | |
'<option value="KZ">Kazakhstan</option>' + | |
'<option value="KE">Kenya</option>' + | |
'<option value="KI">Kiribati</option>' + | |
'<option value="KP">Democratic People\'s Republic of Korea</option>' + | |
'<option value="KR">Republic of Korea</option>' + | |
'<option value="KW">Kuwait</option>' + | |
'<option value="KG">Kyrgyzstan</option>' + | |
'<option value="LA">Lao People\'s Democratic Republic</option>' + | |
'<option value="LV">Latvia</option>' + | |
'<option value="LB">Lebanon</option>' + | |
'<option value="LS">Lesotho</option>' + | |
'<option value="LR">Liberia</option>' + | |
'<option value="LY">Libya</option>' + | |
'<option value="LI">Liechtenstein</option>' + | |
'<option value="LT">Lithuania</option>' + | |
'<option value="LU">Luxembourg</option>' + | |
'<option value="MO">Macao</option>' + | |
'<option value="MK">Macedonia</option>' + | |
'<option value="MG">Madagascar</option>' + | |
'<option value="MW">Malawi</option>' + | |
'<option value="MY">Malaysia</option>' + | |
'<option value="MV">Maldives</option>' + | |
'<option value="ML">Mali</option>' + | |
'<option value="MT">Malta</option>' + | |
'<option value="MH">Marshall Islands</option>' + | |
'<option value="MQ">Martinique</option>' + | |
'<option value="MR">Mauritania</option>' + | |
'<option value="MU">Mauritius</option>' + | |
'<option value="YT">Mayotte</option>' + | |
'<option value="MX">Mexico</option>' + | |
'<option value="FM">Federated States of Micronesia</option>' + | |
'<option value="MD">Republic of Moldova</option>' + | |
'<option value="MC">Monaco</option>' + | |
'<option value="MN">Mongolia</option>' + | |
'<option value="ME">Montenegro</option>' + | |
'<option value="MS">Montserrat</option>' + | |
'<option value="MA">Morocco</option>' + | |
'<option value="MZ">Mozambique</option>' + | |
'<option value="MM">Myanmar</option>' + | |
'<option value="NA">Namibia</option>' + | |
'<option value="NR">Nauru</option>' + | |
'<option value="NP">Nepal</option>' + | |
'<option value="NL">Netherlands</option>' + | |
'<option value="NC">New Caledonia</option>' + | |
'<option value="NZ">New Zealand</option>' + | |
'<option value="NI">Nicaragua</option>' + | |
'<option value="NE">Niger</option>' + | |
'<option value="NG">Nigeria</option>' + | |
'<option value="NU">Niue</option>' + | |
'<option value="NF">Norfolk Island</option>' + | |
'<option value="MP">Northern Mariana Islands</option>' + | |
'<option value="NO">Norway</option>' + | |
'<option value="OM">Oman</option>' + | |
'<option value="PK">Pakistan</option>' + | |
'<option value="PW">Palau</option>' + | |
'<option value="PS">State of Palestine</option>' + | |
'<option value="PA">Panama</option>' + | |
'<option value="PG">Papua New Guinea</option>' + | |
'<option value="PY">Paraguay</option>' + | |
'<option value="PE">Peru</option>' + | |
'<option value="PH">Philippines</option>' + | |
'<option value="PN">Pitcairn</option>' + | |
'<option value="PL">Poland</option>' + | |
'<option value="PT">Portugal</option>' + | |
'<option value="PR">Puerto Rico</option>' + | |
'<option value="QA">Qatar</option>' + | |
'<option value="RE">Reunion</option>' + | |
'<option value="RO">Romania</option>' + | |
'<option value="RU">Russian Federation</option>' + | |
'<option value="RW">Rwanda</option>' + | |
'<option value="BL">Saint Barthelemy</option>' + | |
'<option value="SH">Ascension and Tristan da Cunha Saint Helena</option>' + | |
'<option value="KN">Saint Kitts and Nevis</option>' + | |
'<option value="LC">Saint Lucia</option>' + | |
'<option value="MF">Saint Martin (French part)</option>' + | |
'<option value="PM">Saint Pierre and Miquelon</option>' + | |
'<option value="VC">Saint Vincent and the Grenadines</option>' + | |
'<option value="WS">Samoa</option>' + | |
'<option value="SM">San Marino</option>' + | |
'<option value="ST">Sao Tome and Principe</option>' + | |
'<option value="SA">Saudi Arabia</option>' + | |
'<option value="SN">Senegal</option>' + | |
'<option value="RS">Serbia</option>' + | |
'<option value="SC">Seychelles</option>' + | |
'<option value="SL">Sierra Leone</option>' + | |
'<option value="SG">Singapore</option>' + | |
'<option value="SX">Sint Maarten (Dutch part)</option>' + | |
'<option value="SK">Slovakia</option>' + | |
'<option value="SI">Slovenia</option>' + | |
'<option value="SB">Solomon Islands</option>' + | |
'<option value="SO">Somalia</option>' + | |
'<option value="ZA">South Africa</option>' + | |
'<option value="GS">South Georgia</option>' + | |
'<option value="SS">South Sudan</option>' + | |
'<option value="ES">Spain</option>' + | |
'<option value="LK">Sri Lanka</option>' + | |
'<option value="SD">Sudan</option>' + | |
'<option value="SR">Suriname</option>' + | |
'<option value="SJ">Svalbard and Jan Mayen</option>' + | |
'<option value="SE">Sweden</option>' + | |
'<option value="CH">Switzerland</option>' + | |
'<option value="SY">Syrian Arab Republic</option>' + | |
'<option value="TW">Taiwan</option>' + | |
'<option value="TJ">Tajikistan</option>' + | |
'<option value="TZ">United Republic of Tanzania</option>' + | |
'<option value="TH">Thailand</option>' + | |
'<option value="TL">Timor-Leste</option>' + | |
'<option value="TG">Togo</option>' + | |
'<option value="TK">Tokelau</option>' + | |
'<option value="TO">Tonga</option>' + | |
'<option value="TT">Trinidad and Tobago</option>' + | |
'<option value="TN">Tunisia</option>' + | |
'<option value="TR">Turkey</option>' + | |
'<option value="TM">Turkmenistan</option>' + | |
'<option value="TC">Turks and Caicos Islands</option>' + | |
'<option value="TV">Tuvalu</option>' + | |
'<option value="UG">Uganda</option>' + | |
'<option value="UA">Ukraine</option>' + | |
'<option value="AE">United Arab Emirates</option>' + | |
'<option value="GB">United Kingdom</option>' + | |
'<option value="US" selected>United States</option>' + | |
'<option value="UM">United States Minor Outlying Islands</option>' + | |
'<option value="UY">Uruguay</option>' + | |
'<option value="UZ">Uzbekistan</option>' + | |
'<option value="VU">Vanuatu</option>' + | |
'<option value="VA">Vatican City</option>' + | |
'<option value="VE">Venezuela</option>' + | |
'<option value="VN">Viet Nam</option>' + | |
'<option value="VG">British Virgin Islands</option>' + | |
'<option value="VI">U.S. Virgin Islands</option>' + | |
'<option value="WF">Wallis and Futuna</option>' + | |
'<option value="EH">Western Sahara</option>' + | |
'<option value="YE">Yemen</option>' + | |
'<option value="ZM">Zambia</option>' + | |
'<option value="ZW">Zimbabwe</option>' + | |
'</select>' + | |
'</div>' + | |
'<div class="field street-address" >' + | |
'<label for="street-address"><span class="label">Address</span></label>' + | |
'<textarea id="street-address" name="street-address"></textarea>' + | |
'</div>' + | |
'<div class="field text city" >' + | |
'<label for="city"><span class="label">City</span></label>' + | |
'<input id="city" name="city" type="text" data-us-label="City" data-bm-label="Parish"></input>' + | |
'</div>' + | |
'<div class="field state" >' + | |
'<label for="state">State</label>' + | |
'<select id="state" name="state"><option value=""></option>' + | |
'<option value="AL">Alabama</option>' + | |
'<option value="AK">Alaska</option>' + | |
'<option value="AS">American Samoa</option>' + | |
'<option value="AZ">Arizona</option>' + | |
'<option value="AR">Arkansas</option>' + | |
'<option value="AE">Armed Forces Africa, Canada, Europe, Middle East</option>' + | |
'<option value="AA">Armed Forces Americas (except Canada)</option>' + | |
'<option value="AP">Armed Forces Pacific</option>' + | |
'<option value="CA">California</option>' + | |
'<option value="CO">Colorado</option>' + | |
'<option value="CT">Connecticut</option>' + | |
'<option value="DE">Delaware</option>' + | |
'<option value="DC">District of Columbia</option>' + | |
'<option value="FL">Florida</option>' + | |
'<option value="GA">Georgia</option>' + | |
'<option value="GU">Guam</option>' + | |
'<option value="HI">Hawaii</option>' + | |
'<option value="ID">Idaho</option>' + | |
'<option value="IL">Illinois</option>' + | |
'<option value="IN">Indiana</option>' + | |
'<option value="IA">Iowa</option>' + | |
'<option value="KS">Kansas</option>' + | |
'<option value="KY">Kentucky</option>' + | |
'<option value="LA">Louisiana</option>' + | |
'<option value="ME">Maine</option>' + | |
'<option value="MD">Maryland</option>' + | |
'<option value="MA">Massachusetts</option>' + | |
'<option value="MI">Michigan</option>' + | |
'<option value="MN">Minnesota</option>' + | |
'<option value="MS">Mississippi</option>' + | |
'<option value="MO">Missouri</option>' + | |
'<option value="MT">Montana</option>' + | |
'<option value="NE">Nebraska</option>' + | |
'<option value="NV">Nevada</option>' + | |
'<option value="NH">New Hampshire</option>' + | |
'<option value="NJ">New Jersey</option>' + | |
'<option value="NM">New Mexico</option>' + | |
'<option value="NY">New York</option>' + | |
'<option value="NC">North Carolina</option>' + | |
'<option value="ND">North Dakota</option>' + | |
'<option value="OH">Ohio</option>' + | |
'<option value="OK">Oklahoma</option>' + | |
'<option value="OR">Oregon</option>' + | |
'<option value="PA">Pennsylvania</option>' + | |
'<option value="PR">Puerto Rico</option>' + | |
'<option value="RI">Rhode Island</option>' + | |
'<option value="SC">South Carolina</option>' + | |
'<option value="SD">South Dakota</option>' + | |
'<option value="TN">Tennessee</option>' + | |
'<option value="TX">Texas</option>' + | |
'<option value="VI">US Virgin Islands</option>' + | |
'<option value="UT">Utah</option>' + | |
'<option value="VT">Vermont</option>' + | |
'<option value="VA">Virginia</option>' + | |
'<option value="WA">Washington</option>' + | |
'<option value="WV">West Virginia</option>' + | |
'<option value="WI">Wisconsin</option>' + | |
'<option value="WY">Wyoming</option>' + | |
'</select>' + | |
'</div>' + | |
'<div class="field province" style="display: none">' + | |
'<label for="province">Province</label>' + | |
'<select id="province" name="province"><option value=""></option>' + | |
'<option value="AB">Alberta</option>' + | |
'<option value="BC">British Columbia</option>' + | |
'<option value="MB">Manitoba</option>' + | |
'<option value="NB">New Brunswick</option>' + | |
'<option value="NL">Newfoundland and Labrador</option>' + | |
'<option value="NT">Northwest Territories</option>' + | |
'<option value="NS">Nova Scotia</option>' + | |
'<option value="NU">Nunavut</option>' + | |
'<option value="ON">Ontario</option>' + | |
'<option value="PE">Prince Edward Island</option>' + | |
'<option value="QC">Quebec</option>' + | |
'<option value="SK">Saskatchewan</option>' + | |
'<option value="YT">Yukon Territory</option>' + | |
'</select>' + | |
'</div>' + | |
'<div class="field number zip-code" >' + | |
'<label for="zip-code"><span class="label">ZIP Code</span></label>' + | |
'<input id="zip-code" name="zip-code" class="zipcodeUS" type="number" minlength="5" maxlength="10"></input>' + | |
'</div>' + | |
'<div class="field text postal-code" style="display: none">' + | |
'<label for="postal-code"><span class="label">Postal Code</span></label>' + | |
'<input id="postal-code" name="postal-code" type="text"></input>' + | |
'</div>' + | |
'' + | |
'</div>' + | |
' <div class="section custom-fields">' + | |
' <h3>Additional Information</h3>' + | |
' <div class="field text CustomAccountField_999424" >' + | |
'<label for="CustomAccountField_999424">Source</label>' + | |
'<select id="CustomAccountField_999424" name="CustomAccountField_999424"><option value=""></option>' + | |
'<option value="1115136">Capital</option>' + | |
'<option value="1000448">nexStage</option>' + | |
'<option value="2685952">Non-profit</option>' + | |
'<option value="1000453">Personal</option>' + | |
'<option value="1000451">Ticketing</option>' + | |
'<option value="1000452">Website</option>' + | |
'</select>' + | |
'</div>' + | |
'' + | |
'</div>' + | |
' <div class="section comment">' + | |
' <div class="field text comment" >' + | |
'<label for="comment"><span class="label">Comments</span></label>' + | |
'<textarea id="comment" name="comment" type="text" value="Comments"></textarea>' + | |
'</div>' + | |
'' + | |
'</div>' + | |
' <div class="section consent hidden">' + | |
' <div class="field checkbox consent-all" >' + | |
'<label for="consent-all"><input id="consent-all" name="consent-all" type="checkbox" maxlength="255"></input><span class="label">I would like to receive or continue receiving updates from The Argyros</span></label>' + | |
'</div>' + | |
'<div class="field checkbox consent-email" style="display: none">' + | |
'<label for="consent-email"><input id="consent-email" name="consent-email" type="checkbox" checked="checked" maxlength="255"></input><span class="label">by email</span></label>' + | |
'</div>' + | |
'<div class="field checkbox consent-mail" style="display: none">' + | |
'<label for="consent-mail"><input id="consent-mail" name="consent-mail" type="checkbox" checked="checked" maxlength="255"></input><span class="label">by postal mail</span></label>' + | |
'</div>' + | |
'<div class="field checkbox consent-phone" style="display: none">' + | |
'<label for="consent-phone"><input id="consent-phone" name="consent-phone" type="checkbox" checked="checked" maxlength="255"></input><span class="label">by phone</span></label>' + | |
'</div>' + | |
'' + | |
'</div>' + | |
' ' + | |
' <div class="btn-group">' + | |
' <input class="btn btn-submit btn-submit-interaction" type="submit" value="Submit"/>' + | |
' </div>' + | |
' </form>' + | |
'</div>' + | |
'' + | |
'' + '';var successHtml2705410 = '<div class=\'donation-success\'>' + | |
' <h2>Test</h2>' + | |
' <p>Test</p>' + | |
' ' + | |
'</div>';( function($) {if (!Bloomerang.useInteractionId('2705410')) { | |
html2705410 = '<p style="color: red">Only one Volunteer Activity or Constituent Information form can be used on each page.</p>'; | |
} | |
if (jQuery('#bloomerangForm2705410').length) { | |
jQuery('#bloomerangForm2705410').after(html2705410); | |
}; | |
if (Bloomerang.interactionFormLoaded) { | |
return false; | |
} | |
Bloomerang.interactionFormLoaded = true; | |
jQuery('.interaction-form .section.captcha').attr('style', 'display: none'); | |
Bloomerang.useKey('pub_7f6829f0-1f2c-11e9-9f3d-0aa640fb8062'); | |
// Register proper callbacks for various stages/outcomes of submission | |
Bloomerang.Widget.Interaction.OnSubmit = function (args) { | |
jQuery(".btn-submit-interaction").val("Submitting...").prop("disabled", true).addClass("disabled"); | |
var val = function (selector) { return jQuery(selector).val(); }; | |
Bloomerang.Account | |
.individual() | |
.firstName(val(".interaction-form #first-name")) | |
.lastName(val(".interaction-form #last-name")) | |
.homeEmail(val(".interaction-form #email-address")) | |
.homePhone(val(".interaction-form #phone-number")) | |
.applyInteractionCustomFields(); | |
if (jQuery(".interaction-form #consent-all").prop("checked")) { | |
Bloomerang.Account.optedInStatus(jQuery(".interaction-form #consent-email").prop("checked"), | |
jQuery(".interaction-form #consent-mail").prop("checked"), | |
jQuery(".interaction-form #consent-phone").prop("checked")); | |
} | |
// Always sending the address, even if it's blank, because we need to know the Country for GDPR purposes | |
var country = val(".interaction-form #country"); | |
var state = Bloomerang.Util.getCorrectState(country, val(".interaction-form #state"), val(".interaction-form #province")); | |
var zipCode = Bloomerang.Util.getCorrectZipCode(country, val(".interaction-form #zip-code"), val(".interaction-form #postal-code")); | |
Bloomerang.Account.homeAddress(val(".interaction-form #street-address"), | |
val(".interaction-form #city"), | |
state, | |
zipCode, | |
country); | |
Bloomerang.Interaction.note(val(".interaction-form #comment")); | |
if (jQuery("#volunteer-date").length) { | |
Bloomerang.Interaction.date(jQuery("#volunteer-date").val()); | |
} | |
Bloomerang.Interaction.applyInteractionCustomFields(); | |
}; | |
Bloomerang.ValidateInteractionFormCaptcha = function() { | |
if (typeof(grecaptcha) !== "undefined" && jQuery("#captcha" + Bloomerang.Data.WidgetIds.Interaction).children().length) { | |
var captchaResponse = grecaptcha.getResponse(jQuery(".interaction-form").data("captcha-id")); | |
if (captchaResponse) { | |
jQuery(".interaction-form .noCaptchaResponseError").hide(); | |
Bloomerang.captchaResponse(captchaResponse); | |
return true; | |
} else { | |
jQuery(".interaction-form .noCaptchaResponseError").show(); | |
return false; | |
} | |
} else return true; | |
}; | |
Bloomerang.Api.OnSuccess = Bloomerang.Widget.Interaction.OnSuccess = function (response) { | |
jQuery("#interaction-form-container").html(successHtml2705410); | |
var distance = 100; | |
var offset = jQuery("#interaction-form-container").offset().top; | |
var offsetTop = offset > distance ? offset - distance : offset; | |
jQuery('html, body').animate({ scrollTop : offsetTop}, 500); | |
}; | |
Bloomerang.Api.OnError = Bloomerang.Widget.Interaction.OnError = function (response) { | |
jQuery(".btn-submit-interaction").val("Submit").prop("disabled", false).removeClass("disabled"); | |
jQuery("#interaction-form-container .errors").removeClass("hidden").html(response.Message); | |
var distance = 100; | |
var offset = jQuery("#interaction-form-container .errors").offset().top; | |
var offsetTop = offset > distance ? offset - distance : offset; | |
jQuery('html, body').animate({ scrollTop : offsetTop}, 500); | |
if (typeof(grecaptcha) !== "undefined" && jQuery("#captcha" + Bloomerang.Data.WidgetIds.Interaction).children().length) { | |
grecaptcha.reset(jQuery(".interaction-form").data("captcha-id")); | |
} | |
}; | |
Bloomerang.Util.applyInteractionCustomFields = function (obj, type) { | |
// Clear any fields from a previous failed submission | |
obj.clearCustomFields(); | |
// Apply all <input> (not multiselect), <select> and <textarea> fields | |
jQuery(".interaction-form .section.custom-fields :input:not(a > input, select)[id*=" + type + "]").each(function() { | |
if (jQuery(this).val().hasValue()) { | |
obj.customFreeformField(jQuery(this).attr("id").toUntypedValue(), jQuery(this).val()); | |
} | |
}); | |
// Apply all <select> fields | |
jQuery(".interaction-form .section.custom-fields select[id*=" + type + "]").each(function() { | |
if (jQuery(this).val().hasValue()) { | |
obj.customPickField(jQuery(this).attr("id").toUntypedValue(), jQuery(this).val()); | |
} | |
}); | |
// Apply all multiselect fields | |
jQuery(".interaction-form .section.custom-fields .checkboxes[id*=" + type + "]").each(function() { | |
obj.customPickField(jQuery(this).attr("id").toUntypedValue(), | |
jQuery.map(jQuery(this).children(".checkbox.selected"), function(v) { return jQuery(v).attr("data-id"); })); | |
}); | |
}; | |
String.prototype.hasValue = function() { | |
return (this && jQuery.trim(this)); //IE8 doesn't have a native trim function | |
}; | |
Bloomerang.Account.applyInteractionCustomFields = function () { | |
Bloomerang.Util.applyInteractionCustomFields(this, "Account"); | |
return this; | |
}; | |
Bloomerang.Interaction.applyInteractionCustomFields = function () { | |
Bloomerang.Util.applyInteractionCustomFields(this, "Interaction"); | |
return this; | |
}; | |
String.prototype.toUntypedValue = function() { | |
return this.substring(this.indexOf('_') + 1); | |
}; | |
jQuery.validator.addMethod("phoneUS", function(phone_number, element) { | |
var digits = phone_number.replace(/\D/g, ""); | |
return this.optional(element) || digits.length == 7 || digits.length == 10 || digits.length == 11; | |
}, "Please specify a valid phone number or use '+' for international."); | |
jQuery.validator.addMethod("phoneInternational", function (phone_number, element) { | |
return this.optional(element) || /^\+[0-9\-\(\)\s.]+$/i.test(phone_number); | |
}, "Please specify a valid phone number."); | |
jQuery.validator.classRuleSettings.phoneInternational = { phoneInternational: true }; | |
jQuery.validator.addMethod("zipcodeUS", function (value, element) { | |
return this.optional(element) || /\d{5}-\d{4}$|^\d{5}$/.test(value) | |
}, "The specified US ZIP Code is invalid"); | |
jQuery.validator.addMethod("currency", function (value, element, options) { | |
return !value || | |
value | |
.replace("$", "") | |
.replace(".", "") | |
.split(",").join("") | |
.match(/^\d+$/g); | |
}, "Not a valid currency"); | |
jQuery.validator.classRuleSettings.currency = { currency: true }; | |
jQuery.validator.addMethod("number", function (value, element, options) { | |
return !value || | |
value | |
.replace(".", "") | |
.split(",").join("") | |
.match(/^\d+$/g); | |
}, "Not a valid number"); | |
jQuery.validator.classRuleSettings.number = { number: true }; | |
jQuery.validator.addMethod("validYear", function (value, element, options) { | |
try { | |
return (!value || value.match(/^[1-9]\d\d\d$/)) ? true : false; | |
} | |
catch (e) { | |
return false; | |
} | |
}, function () { return "Must be a 4 digit year"; }); | |
jQuery.validator.classRuleSettings.validYear = { validYear: true }; | |
jQuery(".interaction-form #country").change(function(event) { | |
var element = jQuery(event.target || event.srcElement); // cross-browser event target selection | |
var isInternational = (element.val() != "US" && element.val() != "CA" && element.val() != "BM"); | |
// TODO: Remove this when we have figured out the canada state/province issue | |
Bloomerang.Util.addLog("Pre country change: Country=" + element.val() + ", State=" + jQuery(".interaction-form #state").val() + ", Province=" + jQuery(".interaction-form #province").val() + ", City=" + jQuery(".interaction-form #city").val()); | |
jQuery(".interaction-form #state, .interaction-form #province").val(""); // clear the state when the country changes | |
jQuery(".interaction-form .field.city, .interaction-form .field.state, .interaction-form .field.province, .interaction-form .field.zip-code, .interaction-form .field.postal-code").toggle(!isInternational); | |
if (element.val() == "BM") { | |
jQuery(".interaction-form .field.city .label").text(jQuery(".interaction-form .field.city input").data("bm-label")); | |
} else if (element.val() == "US" || element.val() == "CA") { | |
jQuery(".interaction-form .field.city .label").text(jQuery(".interaction-form .field.city input").data("us-label")); | |
} | |
jQuery(".interaction-form #street-address").toggleClass("international", isInternational); | |
if (element.val() == "US") { | |
jQuery(".interaction-form .field.state, .interaction-form .field.zip-code").show(); | |
jQuery(".interaction-form .field.province, .interaction-form .field.postal-code").hide(); | |
} else if (element.val() == "CA") { | |
jQuery(".interaction-form .field.state, .interaction-form .field.zip-code").hide(); | |
jQuery(".interaction-form .field.province, .interaction-form .field.postal-code").show(); | |
} else if (element.val() == "BM") { | |
jQuery(".interaction-form .field.state, .interaction-form .field.province, .interaction-form .field.zip-code").hide(); | |
jQuery(".interaction-form .field.postal-code").show(); | |
} else { | |
jQuery(".interaction-form #city, .interaction-form #zip-code, .interaction-form #postal-code").val(""); | |
} | |
jQuery(".interaction-form .section.consent").toggleClass("hidden", !Bloomerang.Util.isCountryInEurope(element.val())); | |
// TODO: Remove this when we have figured out the canada state/province issue | |
Bloomerang.Util.addLog("Post country change: Country=" + element.val() + ", State=" + jQuery(".interaction-form #state").val() + ", Province=" + jQuery(".interaction-form #province").val()+ ", City=" + jQuery(".interaction-form #city").val()); | |
}); | |
// TODO: Remove this when we have figured out the canada state/province issue | |
// We use the focusin function to save the previous value so we can log out the previous and new values on change | |
// https://stackoverflow.com/questions/29118178/input-jquery-get-old-value-before-onchange-and-get-value-after-on-change/29118530 | |
jQuery(".interaction-form #state").focusin(function(e) { | |
var element = jQuery(e.target || e.srcElement); // cross-browser event target selection | |
element.data('val', element.val()); | |
}); | |
// TODO: Remove this when we have figured out the canada state/province issue | |
jQuery(".interaction-form #state").change(function(e) { | |
var element = jQuery(e.target || e.srcElement); // cross-browser event target selection | |
var prev = element.data('val'); | |
var current = element.val(); | |
var provinceElement = jQuery(".interaction-form #province"); | |
var prevProvince = provinceElement.data('val'); | |
var currentProvince = provinceElement.val(); | |
Bloomerang.Util.addLog("State Changed: Target=" + e.target.name + ", PreValue=" + prev + ", Value=" + current + ", Province PreValue =" + prevProvince + ", Province CurrentValue =" + currentProvince); | |
}); | |
// TODO: Remove this when we have figured out the canada state/province issue | |
// We use the focusin function to save the previous value so we can log out the previous and new values on change | |
// https://stackoverflow.com/questions/29118178/input-jquery-get-old-value-before-onchange-and-get-value-after-on-change/29118530 | |
jQuery(".interaction-form #province").focusin(function(e) { | |
var element = jQuery(e.target || e.srcElement); // cross-browser event target selection | |
element.data('val', element.val()); | |
}); | |
// TODO: Remove this when we have figured out the canada state/province issue | |
jQuery(".interaction-form #province").change(function(e) { | |
var element = jQuery(e.target || e.srcElement); // cross-browser event target selection | |
var prev = element.data('val'); | |
var current = element.val(); | |
var stateElement = jQuery(".interaction-form #state"); | |
var prevState = stateElement.data('val'); | |
var currentState = stateElement.val(); | |
Bloomerang.Util.addLog("Province Changed: Target=" + e.target.name + ", PreValue=" + prev + ", Value=" + current + ", State PrevValue=" + prevState + ", State Current=" + currentState); | |
}); | |
// TODO: Remove this when we have figured out the canada state/province issue | |
// We use the focusin function to save the previous value so we can log out the previous and new values on change | |
// https://stackoverflow.com/questions/29118178/input-jquery-get-old-value-before-onchange-and-get-value-after-on-change/29118530 | |
jQuery(".interaction-form #city").focusin(function(e) { | |
var element = jQuery(e.target || e.srcElement); // cross-browser event target selection | |
element.data('val', element.val()); | |
}); | |
// TODO: Remove this when we have figured out the canada state/province issue | |
jQuery(".interaction-form #city").change(function(e) { | |
var element = jQuery(e.target || e.srcElement); // cross-browser event target selection | |
var prev = element.data('val'); | |
var current = element.val(); | |
Bloomerang.Util.addLog("City Changed: Target=" + e.target.name + ", PreValue=" + prev + ", Value=" + current); | |
}); | |
jQuery(".interaction-form #phone-number").change(function () { | |
var phoneField = jQuery(".interaction-form #phone-number"); | |
var internationalNumber = phoneField.val().substring(0,1) === '+'; | |
phoneField.toggleClass("phoneUS", !internationalNumber); | |
phoneField.toggleClass("phoneInternational", internationalNumber); | |
}) | |
// Intercept form submission to validate then submit via API | |
jQuery("#interaction-form-container form").validate({ | |
submitHandler: function () { | |
if (!Bloomerang.ValidateInteractionFormCaptcha()) { | |
return false; | |
} | |
// Restore proper callbacks in case there are multiple widgets on the page | |
Bloomerang.Api.OnSubmit = Bloomerang.Widget.Interaction.OnSubmit; | |
Bloomerang.Api.OnSuccess = Bloomerang.Widget.Interaction.OnSuccess; | |
Bloomerang.Api.OnError = Bloomerang.Widget.Interaction.OnError; | |
Bloomerang.Api.submitInteraction(); | |
} | |
}); | |
// Show opt-in options based on the setting of the global opt-in | |
jQuery(".interaction-form .field.consent-all").change(function() { | |
jQuery(".interaction-form .field.consent-all").siblings().each(function(i, e) { | |
jQuery(e).toggle(); | |
}); | |
}); | |
})(jQuery); | |
}; | |
var startBloomerangLoad = function() { | |
if (window.bloomerangLoadStarted == undefined) { | |
window.bloomerangLoadStarted = true; | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = 'https://crm.bloomerang.co/Content/Scripts/Api/Bloomerang-v2.js?nocache=2020-10-01'; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
waitForBloomerangLoad(function() { Bloomerang.Util.requireJQueryValidation(function() { insertForm2705410(); })}); | |
} | |
else { | |
waitForBloomerangLoad(function() { Bloomerang.Util.requireJQueryValidation(function() { insertForm2705410(); })}); | |
} | |
}; | |
var waitForBloomerangLoad = function(callback) { | |
if (typeof(Bloomerang) === 'undefined' || !Bloomerang._isReady) { | |
setTimeout(function () { waitForBloomerangLoad(callback) }, 500); | |
} | |
else { | |
if (true) { | |
callback(); | |
} else { | |
window.bloomerangLoadStarted = undefined; | |
Bloomerang = undefined; // The version of Blomerang.js is not what we want. So blow it away and reload. | |
startBloomerangLoad(); | |
} | |
} | |
}; | |
startBloomerangLoad(); | |
</script></pre> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment