Skip to content

Instantly share code, notes, and snippets.

@jackkitley
Created March 27, 2013 11:10
Show Gist options
  • Save jackkitley/5253431 to your computer and use it in GitHub Desktop.
Save jackkitley/5253431 to your computer and use it in GitHub Desktop.
var myvar;
function doDamage(element)
{
console.log("TYPE:"+typeof element);
myvar = element;
vehicletypesideareaid = myvar.vehicletypesideareaid;
var url = '<?php echo Yii::app()->createUrl("vehicle/DamageForm"); ?>' + '&vehicleid=<?php echo $vehicleid?>&vehicletypesideareaid='+vehicletypesideareaid;
<?php echo CHtml::ajax(array(
'url'=>'js:url',
'data'=> "js:$(this).serialize()",
'type'=>'post',
'dataType'=>'json',
'success'=>"function(data)
{
if (data.status == 'failure')
{
$('#dialogDamage div.divForForm').html(data.div);
$('#dialogDamage div.divForForm form').submit(doDamage);
}
else
{
$('#dialogDamage').dialog('close');
console.log(myvar.paper);
myvar.checked = 'true';
myvar.attr({fill:myvar.paper.on_areacolor,opacity:0.8});
}
} ",
// el.checked = 'false';
// el.attr({fill:el.paper.off_areacolor,opacity:0.5});
))?>;
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment