jquery-mobile: Can't change input value in dialog

Homi69

New Member
I'm having trouble dinamicaly setting the value of textboxes on a dialog opened by a listview item with JQueryMobile.I can change the value, verified by alert before and after, but the value displayed doesn't change.The concept is a listview displaying the items of a shopping list.If the user clicks one of the items a dialog should be displayed with a form for editing the product information.I started by setting the href to the dialog page, and binding to the onclick event. The problem was that the event ran before the page loaded so no items where available.Next I opened the dialog programaticaly on the "onclick" event.I can change the value, but the change isn't displayed.Relevant Snippets are bellow.Thanks in advance for any help.Best RegardsJoao\[code\]<ul data-role="listview" data-inset="true" data-split-theme="b" data-split-icon="star" id="shopping_list_listview" style="margin-bottom:0px"> <li> <a data-rel="dialog" data-transition="pop" href="http://stackoverflow.com/questions/15814521/#" onClick="loadData($(this))"> <span class="product_name truncate" SAMPLE product</span> </a></li>\[/code\]\[code\]function loadData(obj) { $.mobile.changePage('product_dialog.html','pop',false,true) var name = obj.find("span.product_name").text(); alert ($("#popup-product-name").val()); $("#popup-product-name").val(name); alert ($("#popup-product-name").val()); }\[/code\]
 
Top