It looks like you're new here. If you want to get involved, click one of these buttons!
[...]
$templ_options = array();
$templ_attr = "class = 'input_dropdown' id = 'input_dropdown'";
$templ_options[0] = 'Vorlage wählen...';
foreach($templates as $templ) {
$templ_options[$templ['template_id']] = $templ['template_name'];
}
?>
<script type="text/javascript">
$(function() {
$('#input_dropdown').bind('change', function(e) {
$.getJSON('<?=base_url('einsatz/einsatz_admin/json_get_einsatz_template')?>/' + $('#input_dropdown').val(),
function(data) {
$.each(data, function(i,item) {
if (item.field == "einsatzname") { $('#einsatzname').val(item.value); }
else if (item.field == "einsatzlage") { $('#einsatzlage').val(item.value); }
else if (item.field == "einsatzart") {
var arten = item.value.split('|');
$.each(arten, function(index, value) {
$('#t_' + value).attr('checked', true);
});
}
else if (item.field == "einsatzfahrzeug") {
var fahrzeuge = item.value.split('|');
$.each(fahrzeuge, function(index, value) { $('#f_' + value).attr('checked', true); });
}
});
}
);
});
});
</script>
[...]
<tr>
<td colspan='2'><?=form_dropdown('einsatz_template', $templ_options, 0, $templ_attr)?></td>
</tr>
Comments
http://docs.getfuelcms.com/general/forms#block
http://docs.getfuelcms.com/general/layouts#layouts_block_layouts