S
Steven
i need to force a carriage return with a textarea field at X number of
characters. anybody know how to do this?
tks
characters. anybody know how to do this?
tks
Steven said:i need to force a carriage return with a textarea field at X number of
characters. anybody know how to do this?
whta's the carriage return?Randy Webb said:onchange, read its value, insert the returns, and move on.
It depends where you mean to display the text. Normally you don't needwhta's the carriage return?
sTxtBoxValue = sTxtBoxValue + "\r"?
Mick White said:Steven wrote:
It depends where you mean to display the text. Normally you don't need
to insert carriage returns, but if it's for display in HTML page, and
you need to force a break.
sTxtBoxValue = sTxtBoxValue + "<BR>"?
<script language="javascript">
function forceReturn(iMaxLength, sValue){
if (sValue.length > iMaxLength){
sValue = sValue + "\r";
}
}
</script>
<textarea name="txt" onKeyUp="forceReturn('5', this.value);" rows="5"
cols="10"></textarea>
Steven said:i need to force a carriage return with a textarea field at X number of
characters. anybody know how to do this?
The above script is nonsense, sorry. Notwithstanding Rob's caveats,Mick said:<script type="text/javascript">
function forceReturn(iMaxLength,sValue){
if (sValue.value.length > iMaxLength){
sValue.value += "\r";
}
}
</script>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.