Jump to content
  • 0

Limiting # of characters in Text Area and Yahoo map bubble


merconline

Question

Does anyone know how you cap the number of characters that can be entered in a Web Form in the Text Area? It lets me select, say, 40 characters wide by 5 lines. But if a user puts in more than that it passes right through and then the Yahoo map bubble with that information is huge.

So is there a way to limit the amount of text that can be inputted in a Text Area? (Note: when i tried to use Text Field instead my form looked awful because the field was just the normal one-line by about 25 characters wide so you couldn't see what you were writing.)

And is there something you add to the HTML to limit the amount of text that shows in a Yahoo map bubble when you scroll over or click on it?

Thanks!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

You can set the Data Type of the field in the table to text 255 rather than text 4000 and in the web form still set the form element as text area, however if 255 characters are still a lot, you need to use a Java Script to limit the texts.

Following is a Java Script limiting the text entered in a text area, you can put this on an HTML block.

function limitText() {

var limitField = document.forms.caspioform.InsertRecordDescription;

var limitCount = document.forms.caspioform.InsertRecordCountdown;

var limitNum = 100;

if (limitField.value.length > limitNum) {

limitField.value = limitField.value.substring(0, limitNum);

} else {

limitCount.value = limitNum - limitField.value.length;

}

}

function makereadonly() {

document.forms.caspioform.InsertRecordDescription.focus();

}

document.forms.caspioform.InsertRecordCountdown.onfocus=makereadonly;

document.forms.caspioform.InsertRecordDescription.onkeydown=limitText;

document.forms.caspioform.InsertRecordDescription.onkeyup=limitText;

Please note that the name of the fields in InsertRecordFIELDNAME needs to be replaced with your table corresponding field names.

Best,

Bahar M.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...