populate_form($array_data)
{
//Format: $array_data['css_selector'] = "value";
$html = "<script>\n$(document).ready(function(){\n";
foreach($array_data as $key => $val)
{
$html .= "$('$key').val('$val');\n";
}
$html .= "});\n</script>";
return $html;
}
I just coded this function but havent used it yet. I wonder if this is approach for populating form with data is a good idea.