Comments on: How to Add Character Limits to Fields in Pardot Forms https://thespotforpardot.com/2019/10/09/adding-character-limits-to-pardot-form-fields/ A home for marketers on Salesforce to shape the future together Wed, 14 Dec 2022 11:15:15 +0000 hourly 1 https://wordpress.org/?v=6.7.1 By: Allie Cappitelli https://thespotforpardot.com/2019/10/09/adding-character-limits-to-pardot-form-fields/#comment-1620 Fri, 10 Sep 2021 12:47:02 +0000 https://thespotforpard.wpengine.com/?p=2396#comment-1620 In reply to Ken.

Hi Ken! Give the following code a try:

$(document).ready(function(){
function limits(obj, limit){
var text = $(obj).val();
var length = text.length;
if(length > limit){
$(obj).val(text.substr(0,limit));
$(“span.out-max”).html(“Invalid length for field value”);
$(this).addClass(‘text-danger’);
}
}
$(‘textarea’).keyup(function(){
limits($(this), 20);
})
})

]]>
By: Ken https://thespotforpardot.com/2019/10/09/adding-character-limits-to-pardot-form-fields/#comment-1619 Thu, 22 Jul 2021 20:48:03 +0000 https://thespotforpard.wpengine.com/?p=2396#comment-1619 Any solutions are someone who pastes in their comment? Your able to bypass your code if user simply pastes Comment value.

]]>
By: Mark Larson https://thespotforpardot.com/2019/10/09/adding-character-limits-to-pardot-form-fields/#comment-1618 Tue, 16 Feb 2021 17:35:14 +0000 https://thespotforpard.wpengine.com/?p=2396#comment-1618 In reply to Marina.

Hi Marina, it looks like some characters in our code weren’t rendering correctly. I’ve updated the code block, so you should have better luck next time around!

]]>
By: Marina https://thespotforpardot.com/2019/10/09/adding-character-limits-to-pardot-form-fields/#comment-1617 Mon, 11 Jan 2021 11:08:44 +0000 https://thespotforpard.wpengine.com/?p=2396#comment-1617 Hi, I tried using this code too but unfortunately it didn’t work.
Can you please advise?
Thank you

]]>
By: Smitten Mitten https://thespotforpardot.com/2019/10/09/adding-character-limits-to-pardot-form-fields/#comment-1616 Wed, 20 May 2020 19:42:27 +0000 https://thespotforpard.wpengine.com/?p=2396#comment-1616 Hi there! I tried using the code here in my pardot form and it didn’t work. Is there anything else that needs to be done? Or this code not working anymore? Please advise. Thanks!

]]>
By: How to Limit Characters on a Pardot Form Textarea – Thompson Technology LLC https://thespotforpardot.com/2019/10/09/adding-character-limits-to-pardot-form-fields/#comment-1615 Mon, 20 Apr 2020 11:14:46 +0000 https://thespotforpard.wpengine.com/?p=2396#comment-1615 […] Recently we had a client request to limit characters on the comments textarea of a Pardot form. After searching high and low, we did find one beneficial blog on the subject, but it did not suit our purposes exactly, so we used that to build on and created our own. You can find it here written by Allie Cappetteli : https://thespotforpardot.com/2019/10/09/adding-character-limits-to-pardot-form-fields/ […]

]]>
By: Sarah https://thespotforpardot.com/2019/10/09/adding-character-limits-to-pardot-form-fields/#comment-1614 Thu, 09 Apr 2020 14:33:01 +0000 https://thespotforpard.wpengine.com/?p=2396#comment-1614 I tried to apply this to a text area it didn’t work, even after swapping out the first two inputs. Do you know what I’m doing wrong? Thanks in advance!

]]>