2

At now in view I have a ajax button and pass data like this

echo CHtml::ajaxButton(...,'js:$("#a").sortable("serialize")',..)

but how to pass this data with a form if i want to use form model?

shayan
  • 141
  • 1
  • 5
  • 16
  • Add the javascript code for that to the js parameter as well. What stops you from doing so? – hakre Dec 21 '11 at 18:16
  • [See this if it can help you out][1] [1]: http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit it will give some idea atleast – vishal_g Jan 06 '12 at 09:35

1 Answers1

0

jQuery is native to Yii, so for a start, use that.

Then just do something like (untested):

$('form').submit( function() {
  $.post('/url/', $(this).serialize()); 
});
Dan Blows
  • 19,395
  • 9
  • 60
  • 93