Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
138
rated 0 times [  143] [ 5]  / answers: 1 / hits: 34023  / 12 Years ago, sat, april 28, 2012, 12:00:00
$(#note_content).dialog({
title: Note,
modal: true,
width:'auto',
height:'auto',
resizable:false,

open: function(){
var note_text = $('#note_content').attr('note_text');
}
}


In my code I am trying set note_text as content of dialog, any idea how could I do this?


More From » jquery

 Answers
18

You should have a content place holder inside your dialog, for example:



<div id=noteContent title=Basic dialog>
<p id=contentholder> This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

$(#note_content).dialog({
title: Note,
modal: true,
width:'auto',
height:'auto',
resizable:false,

open: function(){
var note_text = $('#note_content').attr('note_text');
$(#contentholder).val(note_text)
}
}


You had your note_text assigned to a variable in this line:



var note_text = $('#note_content').attr('note_text');


However, you didn't assign the note_text variable to the placeholder.


[#85914] Thursday, April 26, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
keric

Total Points: 572
Total Questions: 93
Total Answers: 97

Location: Cyprus
Member since Mon, Oct 24, 2022
2 Years ago
;