Manoj Nayak
Manoj Nayak

Reputation: 2509

Jquery Newline doesnot display on message popup

I have code which displays a confirmation popup.

 string message = "Do you want to set activity to Inactive? " ;
 message += "The predefined settings will be reset for all the users using this Activity.";
 SetToInactiveCheckBox.Attributes["onclick"] = "if($('input[id*=SetToInactiveCheckBox]:checkbox:checked').length > 0 ) return confirm('"+ message +"');";

I want the two lines to be printed in separate lines. I tried in a following ways

string message = "Do you want to set activity to Inactive? \n" ;
 string message = "Do you want to set activity to Inactive? '\r\n'" ;
 string message = "Do you want to set activity to Inactive? '<br/>'" ;

How too display the messages in separate lines. I am using IE8.

Upvotes: 0

Views: 205

Answers (2)

Borja Alvarez
Borja Alvarez

Reputation: 199

You should use

<br />

instead of

'<br />'

This worked for me.

Upvotes: 1

captainsac
captainsac

Reputation: 2490

You can use

\n or \r\n. 

If that does not work then use

\\r\\n

Upvotes: 2

Related Questions