Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1805 How can I take "wrapped" text from a form's input field, and at some event of my chosing, double-space it?

irt.org | Knowledge Base | JavaScript | form 3.5 | Q1805 [ previous next ]

Q1805 How can I take "wrapped" text from a form's input field, and at some event of my chosing, double-space it?

Try this:

<script>
var cr = '\n';
function doublespace(formField) {
  return formField.value.replace(cr,cr+cr);
</script>

Or to use an event handler directly:

<textarea rows=10 onChange="cr='\n';this.value=this.value.replace(cr,cr+cr)" wrap="hard"<>/textarea>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.