Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TextArea character size limit

Featured Replies

Is there a way to limit the number of characters in a TextArea? For example this message box I am typing in... Is there a way to limit it so I cannot type any more characters?

Thanks!

Hmmm... not as far as I know. It's more an HTML issue than anything to do with FMP though.

You can use field validation to do it: the user will get a warining after submitting the form that they've typed too much, but that might not be what you want either.

Perhaps somebody will have some Java code to do it!

There's an excellent javascript (free use too!!) from Ronnie Moore> It even has a counter that tell you how many characters are left.

<!-- TWO STEPS TO INSTALL LIMIT TEXTAREA:

1. Copy the coding into the HEAD of your HTML document

2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Original: Ronnie T. Moore -->

<!-- Web Site: The JavaScript Source -->

<!-- Dynamic 'fix' by: Nannette Thacker -->

<!-- Web Site: http://www.shiningstar.net -->

<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin

function textCounter(field, countfield, maxlimit) {

if (field.value.length > maxlimit) // if too long...trim it!

field.value = field.value.substring(0, maxlimit);

// otherwise, update 'characters left' counter

else

countfield.value = maxlimit - field.value.length;

}

// End -->

</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<!-- textCounter() parameters are: text field, the count field, max length -->

<center>

<form name=myform action="YOUR-SCRIPT.CGI">

<font size="1" face="arial, helvetica, sans-serif"> ( You may enter up to 125 characters. )<br>

<textarea name=message wrap=physical cols=28 rows=4 onKeyDown="textCounter(this.form.message,this.form.remLen,125);" onKeyUp="textCounter(this.form.message,this.form.remLen,125);"></textarea>

<br>

<input readonly type=text name=remLen size=3 maxlength=3 value="125"> characters left</font>

</form>

</center>

<p><center>

<font face="arial, helvetica" SIZE="-2">Free JavaScripts provided<br>

by <a href="http://javascriptsource.com">The JavaScript Source</a></font>

</center><p>

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.