I have made a form using form-builder, and I want to change a particular field in a form made with it so that I can display a character count and limit the amount of characters in it, like this fiddle.
$('#textarea').keyup(function() {
var text_length = $('#elm_82').val().length;
var text_remaining = text_max - text_length;
$('#textarea_feedback').html(text_remaining + ' characters remaining');
});
});
However, I need to add an attribute to the field elm_82;
maxlength="1000"
and place a div underneath to display the actual count (i.e. XX characters remaining);
in order to "implement" the feature. However I am struggling to find where and how I can add it, anyone able to give me a hint or point me in the correct direction?
I think you would be better served in this case to NOT use form builder but instead to do an html page with a custom form in it. I'm assuming that your form will not be changed frequently. You would need to add the backend support to store the form data or send an email or whatever you want to do with the data.
But I'm not sure you could (or it wouldn't be worth it to) "bend" form builder to do what you want for only specific fields, especially without modifying distributed code.
You might be able to get it to work for all textarea fields, but you will struggle to get it iin place for a single field on a single page.