Hi guys, I have a filled-in PHP table from Mysql, and I use JQuery to listen if a button is clicked, and if I click it, it will capture notes by the name they clicked. Everything works great, there is only one problem. Sometimes, when you click on it and a dialog box opens (JQuery UI), there is nothing in the text area. If you click it again, a popup will appear. So it seems, sometimes, maybe the value is thrown away? I am not sure and can use a hand.
code:
$(document).ready(function () { $(".NotesAccessor").click(function () { notes_name = $(this).parent().parent().find(".user_table"); run(); }); }); function run(){ var url = '/pcg/popups/grabnotes.php'; showUrlInDialog(url); sendUserfNotes(); } function showUrlInDialog(url) { var tag = $("#dialog-container"); $.ajax({ url: url, success: function(data) { tag.html(data).dialog ({ width: '100%', modal: true }).dialog('open'); } }); } function sendUserfNotes() { $.ajax({ type: "POST", dataType: "json", url: '/pcg/popups/getNotes.php', data: { 'nameNotes': notes_name.text() }, success: function(response) { $('#notes_msg').text(response.the_notes) } }); } function getNewnotes(){ new_notes = $('#notes_msg').val(); update(new_notes); }
Let me know if you need anything else!
UPDATE:
Main layout
<div> <div> other stuff... the table </div> </div>
source share