Featured post
jQuery UI dialog form, not sending correct variable -
i'm loading customer info page using jquery. there's list of customers link next it:
<a href="#" onclick="load_customer(<?php echo $c->id; ?>);return false;">view</a>
that triggers function:
function load_customer(id) { $("#dashboard").load('get_info/' + id); }
that works perfectly. on page i'm loading, have jquery ui modal dialog form adding new information.
<div id="addinfo"> <form><input type="hidden" name="customer_id" value="<?php echo $c->id; ?>" /></form> </div>
my javascript:
$("#addinfobutton").click(function(){ $("#addinfo").dialog("open"); return false; }); $("#addinfo").dialog({ autoopen:false, width:400, height:550, modal: true });
when select customer first time, populates hidden field correctly, stays same after selecting other customers.
i thought loading new customer page, form reset well... apparently it's being stored/cached somewhere. if echo id anywhere else in page, shows correctly... not in "addinfo" div.
any help/suggestions appreciated! thanks!
jquery dialog's dont reload content when open them. tend have ajax call replacing content of div dialog on (or tweakng values in it) when dialog opened.
if want hidden field, wouldn't put within dialog, should able retrieve value outside dialog.
- Get link
- X
- Other Apps
Comments
Post a Comment