Skip to content

Instantly share code, notes, and snippets.

@hmic
Created September 22, 2014 11:34
Show Gist options
  • Save hmic/9bbe0f10183af59d7f4f to your computer and use it in GitHub Desktop.
Save hmic/9bbe0f10183af59d7f4f to your computer and use it in GitHub Desktop.
<?php
echo $this->Form->create('Event');
echo $this->Form->input('Event.reservation_id', array('empty' => __('Create a reservation for this event'), 'required' => false));
echo $this->Form->end();
$this->Js->buffer('urls.reservationsGet = "' . $this->Html->url(array('controller' => 'reservations', 'action' => 'get')) . '/";');
?>
<script type="text/javascript">
$('#EventReservationId').on('change', function() {
$.ajax(urls.reservationsGet + $(this).val());
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment