Filter textarea input data Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!HTML text input allow only numeric inputConvert form data to JavaScript object with jQueryDisable/enable an input with jQuery?Removing input background colour for Chrome autocomplete?How to remove border (outline) around text/input boxes? (Chrome)Is there any way to change input type=“date” format?How does data binding work in AngularJS?How do I get the value of text input field using JavaScript?Is there a float input type in HTML5?Can't bind to 'ngModel' since it isn't a known property of 'input'

two integers one line calculator

How much damage would a cupful of neutron star matter do to the Earth?

Are the endpoints of the domain of a function counted as critical points?

Why do early math courses focus on the cross sections of a cone and not on other 3D objects?

Mounting TV on a weird wall that has some material between the drywall and stud

What is a more techy Technical Writer job title that isn't cutesy or confusing?

As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?

Tips to organize LaTeX presentations for a semester

Where is the Next Backup Size entry on iOS 12?

Did any compiler fully use 80-bit floating point?

The Nth Gryphon Number

Is multiple magic items in one inherently imbalanced?

Understanding p-Values using an example

Why not send Voyager 3 and 4 following up the paths taken by Voyager 1 and 2 to re-transmit signals of later as they fly away from Earth?

The test team as an enemy of development? And how can this be avoided?

Asymptotics question

Google .dev domain strangely redirects to https

Relating to the President and obstruction, were Mueller's conclusions preordained?

Co-worker has annoying ringtone

How does the math work when buying airline miles?

What is the difference between a "ranged attack" and a "ranged weapon attack"?

Can two person see the same photon?

Printing attributes of selection in ArcPy?

What would you call this weird metallic apparatus that allows you to lift people?



Filter textarea input data



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!HTML text input allow only numeric inputConvert form data to JavaScript object with jQueryDisable/enable an input with jQuery?Removing input background colour for Chrome autocomplete?How to remove border (outline) around text/input boxes? (Chrome)Is there any way to change input type=“date” format?How does data binding work in AngularJS?How do I get the value of text input field using JavaScript?Is there a float input type in HTML5?Can't bind to 'ngModel' since it isn't a known property of 'input'



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















want to achieve such a function



  1. when textarea is submitted to the database, line breaks are removed (eg n --> "bar2019").

  2. data exported from the databased and show, the same effect as div.output (eg "bar2019" --> <bar> || n).

1: when str += "bar2019":



str = str.replace (/bar2019/g, "<br>");



only the last "bar2019" can be replaced



2: when str += "n":



str = str.replace (/n/g, "<br>");



all "n" can be replaced



function filterData(e) 
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;






var dataInput = document.getElementById("dataInput"),
dataOutput = document.getElementById("dataOutput"),
str = "";

function filterData(e)
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


// console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;


dataInput.addEventListener("change", filterData, false);
dataInput.addEventListener("input", filterData, false);
dataInput.addEventListener("keypress", filterData, false);
dataInput.addEventListener("keyup", filterData, false);
dataInput.addEventListener("plate", filterData, false);

.data-filter 
width: 90%;
margin: 20px auto;
overflow: hidden;


.data-filter>textarea,
.data-filter>div
width: 48%;
min-height: 300px;
padding: 10px;
border: 1px solid #aaa;
float: left;


.data-filter>div
color: #f80;

<div class="data-filter">
<textarea name="dataInput" id="dataInput" placeholder="Data input"></textarea>
<div id="dataOutput"></div>
</div>












share|improve this question
























  • What is the error? Are you sure str has a value at all?

    – Lajos Arpad
    Mar 22 at 12:37

















0















want to achieve such a function



  1. when textarea is submitted to the database, line breaks are removed (eg n --> "bar2019").

  2. data exported from the databased and show, the same effect as div.output (eg "bar2019" --> <bar> || n).

1: when str += "bar2019":



str = str.replace (/bar2019/g, "<br>");



only the last "bar2019" can be replaced



2: when str += "n":



str = str.replace (/n/g, "<br>");



all "n" can be replaced



function filterData(e) 
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;






var dataInput = document.getElementById("dataInput"),
dataOutput = document.getElementById("dataOutput"),
str = "";

function filterData(e)
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


// console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;


dataInput.addEventListener("change", filterData, false);
dataInput.addEventListener("input", filterData, false);
dataInput.addEventListener("keypress", filterData, false);
dataInput.addEventListener("keyup", filterData, false);
dataInput.addEventListener("plate", filterData, false);

.data-filter 
width: 90%;
margin: 20px auto;
overflow: hidden;


.data-filter>textarea,
.data-filter>div
width: 48%;
min-height: 300px;
padding: 10px;
border: 1px solid #aaa;
float: left;


.data-filter>div
color: #f80;

<div class="data-filter">
<textarea name="dataInput" id="dataInput" placeholder="Data input"></textarea>
<div id="dataOutput"></div>
</div>












share|improve this question
























  • What is the error? Are you sure str has a value at all?

    – Lajos Arpad
    Mar 22 at 12:37













0












0








0








want to achieve such a function



  1. when textarea is submitted to the database, line breaks are removed (eg n --> "bar2019").

  2. data exported from the databased and show, the same effect as div.output (eg "bar2019" --> <bar> || n).

1: when str += "bar2019":



str = str.replace (/bar2019/g, "<br>");



only the last "bar2019" can be replaced



2: when str += "n":



str = str.replace (/n/g, "<br>");



all "n" can be replaced



function filterData(e) 
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;






var dataInput = document.getElementById("dataInput"),
dataOutput = document.getElementById("dataOutput"),
str = "";

function filterData(e)
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


// console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;


dataInput.addEventListener("change", filterData, false);
dataInput.addEventListener("input", filterData, false);
dataInput.addEventListener("keypress", filterData, false);
dataInput.addEventListener("keyup", filterData, false);
dataInput.addEventListener("plate", filterData, false);

.data-filter 
width: 90%;
margin: 20px auto;
overflow: hidden;


.data-filter>textarea,
.data-filter>div
width: 48%;
min-height: 300px;
padding: 10px;
border: 1px solid #aaa;
float: left;


.data-filter>div
color: #f80;

<div class="data-filter">
<textarea name="dataInput" id="dataInput" placeholder="Data input"></textarea>
<div id="dataOutput"></div>
</div>












share|improve this question
















want to achieve such a function



  1. when textarea is submitted to the database, line breaks are removed (eg n --> "bar2019").

  2. data exported from the databased and show, the same effect as div.output (eg "bar2019" --> <bar> || n).

1: when str += "bar2019":



str = str.replace (/bar2019/g, "<br>");



only the last "bar2019" can be replaced



2: when str += "n":



str = str.replace (/n/g, "<br>");



all "n" can be replaced



function filterData(e) 
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;






var dataInput = document.getElementById("dataInput"),
dataOutput = document.getElementById("dataOutput"),
str = "";

function filterData(e)
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


// console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;


dataInput.addEventListener("change", filterData, false);
dataInput.addEventListener("input", filterData, false);
dataInput.addEventListener("keypress", filterData, false);
dataInput.addEventListener("keyup", filterData, false);
dataInput.addEventListener("plate", filterData, false);

.data-filter 
width: 90%;
margin: 20px auto;
overflow: hidden;


.data-filter>textarea,
.data-filter>div
width: 48%;
min-height: 300px;
padding: 10px;
border: 1px solid #aaa;
float: left;


.data-filter>div
color: #f80;

<div class="data-filter">
<textarea name="dataInput" id="dataInput" placeholder="Data input"></textarea>
<div id="dataOutput"></div>
</div>








var dataInput = document.getElementById("dataInput"),
dataOutput = document.getElementById("dataOutput"),
str = "";

function filterData(e)
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


// console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;


dataInput.addEventListener("change", filterData, false);
dataInput.addEventListener("input", filterData, false);
dataInput.addEventListener("keypress", filterData, false);
dataInput.addEventListener("keyup", filterData, false);
dataInput.addEventListener("plate", filterData, false);

.data-filter 
width: 90%;
margin: 20px auto;
overflow: hidden;


.data-filter>textarea,
.data-filter>div
width: 48%;
min-height: 300px;
padding: 10px;
border: 1px solid #aaa;
float: left;


.data-filter>div
color: #f80;

<div class="data-filter">
<textarea name="dataInput" id="dataInput" placeholder="Data input"></textarea>
<div id="dataOutput"></div>
</div>





var dataInput = document.getElementById("dataInput"),
dataOutput = document.getElementById("dataOutput"),
str = "";

function filterData(e)
str = this.value;

if (e.keyCode === 13)
// error: bar2019 ?
// str += "bar2019";
// good: n
str += "n";


// console.log(this.value);
// error: bar2019 ?
// str = str.replace(/bar2019/g, "<br>");
// good: n
str = str.replace(/n/g, "<br>");
dataOutput.innerHTML = str;


dataInput.addEventListener("change", filterData, false);
dataInput.addEventListener("input", filterData, false);
dataInput.addEventListener("keypress", filterData, false);
dataInput.addEventListener("keyup", filterData, false);
dataInput.addEventListener("plate", filterData, false);

.data-filter 
width: 90%;
margin: 20px auto;
overflow: hidden;


.data-filter>textarea,
.data-filter>div
width: 48%;
min-height: 300px;
padding: 10px;
border: 1px solid #aaa;
float: left;


.data-filter>div
color: #f80;

<div class="data-filter">
<textarea name="dataInput" id="dataInput" placeholder="Data input"></textarea>
<div id="dataOutput"></div>
</div>






javascript regex input keyboard regexp-replace






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 16 at 9:58







Phoenix

















asked Mar 22 at 11:54









PhoenixPhoenix

1618




1618












  • What is the error? Are you sure str has a value at all?

    – Lajos Arpad
    Mar 22 at 12:37

















  • What is the error? Are you sure str has a value at all?

    – Lajos Arpad
    Mar 22 at 12:37
















What is the error? Are you sure str has a value at all?

– Lajos Arpad
Mar 22 at 12:37





What is the error? Are you sure str has a value at all?

– Lajos Arpad
Mar 22 at 12:37












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55299072%2ffilter-textarea-input-data%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55299072%2ffilter-textarea-input-data%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현