JQuery object of an array to string -
i retrieved object of array code behind(php) jquery , get:
array ( [0] => stdclass object ( [mfid] => 1 [mfname] => customer id [ftid] => 1 [dtid] => 1 [mfkey] => 0 [mfwskey] => [mfwsname] => [mfrequired] => 1 [mfdefaultvalue] => [mfmin] => 0 [mfmax] => 0 [mfduedate] => 0 [mftobepaid] => 0 [mfmaxlength] => 50 [mforderno] => 1 [mfstatus] => 1 ) )
i want mfname array input object, lets say
$("#fname").val(data[0]['mfname']);
but not work.
usually in php before returning client,
$val = $array[0]->mfname;
how can in jquery?
// return json encoded array in php side
var arr = json.parse(yourarray); alert(arr[0].mfname);
hope find using this
Comments
Post a Comment