faqts : Computers : Programming : Languages : JavaScript : Language Core : Strings

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 5 people (40%) answered Yes
Recently 2 of 5 people (40%) answered Yes

Entry

i need to test for the condition newline \n tab \t and \r to see if it is present in form input.

Jun 5th, 2003 08:17
Gran Causa, tom alderson,


var form_input = 'mucho pocho es\tes\nmucho pocho es\tes';
var ntr_re = /\n|\t|\r/;
if (ntr_re.test(form_input)) 
  alert('with ntr');
else
  alert('without ntr');