Splunk Search

show text in the next line

vikas_gopal
Builder

Hello Everyone,
Using javascript I am showing some text in a read only text box, now I want to add another line to this box .In java script I used

 var value1 = "Month End Closure Report" + " - " + n + "  " + yyyy ; //here n is month name
 var value2 = "hello" + " - " + p + "  " + yyyy ;   //here p is day name 
 var value3= value1 +'\n' + value2;
 document.getElementById('text1').value =value3;
 alert(value3);

Alert shows correct data (I mean hello-Sun2014 in the next line)e.g.
"Month End Closure Report - March2014
hello-Sun2014"

Problem:- text box which I designed in simplexml is not showing Hello string in the next line.It appears in a single line like "Month End Closure Report - March2014 hello-Sun2014".

 <html >
  <input type ="text"  id = "text1" value= "" readonly="readonly" textmode="multiline"  />

  </html>

Please suggest what is missing..?

Tags (1)
0 Karma
1 Solution

aelliott
Motivator

aelliott
Motivator

vikas_gopal
Builder

@aelliott Thanks for your time..
It works fine with textarea but I was having problem with the text alignment so I used label and it works fine..thanks again

0 Karma

aelliott
Motivator

I normally use http://www.w3schools.com/tags/tag_textarea.asp for multiple line text boxes

0 Karma

vikas_gopal
Builder

again same result it's appearing fine in the alert but not in the text box .Seems like some property of text box restricting it.

0 Karma

aelliott
Motivator
0 Karma

vikas_gopal
Builder

thanks for the quick response
I replaced r with br but it won't work, now it's like
var value3= value1 +'
' + value2;
How I can type replace command in the existing code..?

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...