Jump to content

Recommended Posts

Hi,

I have the following code that populates a modal

		$('#userDeleteConfirmationModal').on('show.bs.modal', function(event) {
		// Button that triggered the modal
		var button = $(event.relatedTarget)
		//data elements
		var userid = button.data('userid')
		var activesheets = button.data('activesheets').split(", ").join("\n")
		console.log(activesheets);
		var modal = $(this)
		modal.find('#deleteUserConfLabel').text(userid)
		modal.find('#active-sheets-label').text('This user has the following active sheets')
		modal.find('#active-sheets').text(activesheets)

the console log outputs

Job 1

Job 2

but the text.(activesheets) shows them on the same line when they hit the page.

Any ideas?

1 hour ago, Barand said:

You need "<br>" for newlines in an html document ("\n" and multiple spaces are ignored unless between <pre>..</pre> tags or in a <textarea>)

when i use <br/> it echos that exactly.

A new event<br/>Chelsea's Event

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.