You can find solution inside code down here, just read it carefuly. I used
fancybox, but easily you can use some other functions from jquery. I
recommend you fancybox for this kind of action.

<div class="add-feedback">
<a class="rize-feedback buttonb" href="#feedback-form-div"><?php __('Submit
feedback'); ?></a>
<div class="feedbacks" id="feedback-form-div" style="display:none;">
<h2><?php __('Feedback'); ?></h2>
<?php echo $this->Form->create('Feedback', array('id' => 'feedback-form',
'controller' => 'feedbacks', 'action' => 'add'));?>
<label for="rate-value"><?php __('Rate this ride'); ?></label>
<?php echo $this->Form->input('rate', array('type' => 'hidden', 'id' =>
'rate-value')); ?>
<div class="star"></div>
<?php echo $this->Form->input('ride_id', array('type' => 'hidden', 'value'
=> $ride['Ride']['id'])); ?>
<?php echo $this->Form->input('comment', array('type' => 'textfield')); ?>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(".rize-feedback").fancybox({
fitToView : false,
width : '70%',
height : '70%',
autoSize : true,
closeClick : false,
openEffect : 'none',
closeEffect : 'none'
});
$('.star').raty({
  cancel     : true,
  target     : '#rate-value',
  targetKeep : true,
  targetType : 'number'
});
 $("#feedback-form").submit(function(){
$.fancybox.showLoading();
$.ajax({
  type: "POST",
  url: $(this).attr('action'),
  data: $("#feedback-form").serialize(),
}).done(function( msg ) {
   $.fancybox.hideLoading();
   json = jQuery.parseJSON(msg);
   $('#feedback-form').hide();
   $('#feedback-form-div h2').text(json.Success.title);
   $('#feedback-form-div').append('<p class="pop-success">' +
json.Success.message + '</p>');
});
return false;
})
})
</script>




-- 
*Ivan Rimac***
mail: ivn...@gmail.com
*tel: +385 95 555 99 66*
*http://ivanrimac.com*

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to