Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<script>
jQuery(document).ready(function ($) {
"use strict";
$('#field_headb1, #field_headb2').on('keyup', function() {
var characters = $(this).val().length,
target_elem = "frm_field_" + $(this).attr("data-target") + "_container";
/* write the count to the element */
$(target_elem).html( characters + ' characters');
});
});
</script>
<div id="frm_field_[id]_container" class="frm_form_field form-field [required_class][error_class]">
<label for="field_[key]" class="frm_primary_label">[field_name]
<span class="frm_required">[required_label]</span>
</label>
[input data-target="118"]
[if description]<div class="frm_description" id="frm_desc_field_[key]">[description]</div>[/if description]
[if error]<div class="frm_error">[error]</div>[/if error]
</div>
<div id="frm_field_[id]_container" class="frm_form_field form-field [required_class][error_class]">
<label for="field_[key]" class="frm_primary_label">[field_name]
<span class="frm_required">[required_label]</span>
</label>
[input]
[if description]<div class="frm_description" id="frm_desc_field_[key]">[description]</div>[/if description]
[if error]<div class="frm_error">[error]</div>[/if error]
</div>
<div id="frm_field_104_container" class="frm_form_field form-field frm_top_container frm_two_thirds frm_first">
<label for="field_vg9ks" class="frm_primary_label">Encrypted String
<span class="frm_required"></span>
</label>
<input type="text" id="field_vg9ks" name="item_meta[104]" value="" data-invmsg="Text is invalid" data-target="118" readonly="readonly" aria-describedby="frm_desc_field_vg9ks">
<div class="frm_description" id="frm_desc_field_vg9ks">String Encrypted with AES-256-CBC Cipher Method</div>
</div>
<div id="frm_field_104_container" class="frm_form_field form-field frm_top_container frm_two_thirds frm_first">
<label for="field_vg9ks" class="frm_primary_label">Encrypted String
<span class="frm_required"></span>
</label>
<input type="text" id="field_vg9ks" name="item_meta[104]" value="" data-invmsg="Text is invalid" readonly="readonly" aria-describedby="frm_desc_field_vg9ks">
<div class="frm_description" id="frm_desc_field_vg9ks">String Encrypted with AES-256-CBC Cipher Method</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment