<?php foreach ($result as $row): echo "<a href='#' id='thing_{$row->id}'>clicky</a>"; //adds click event to the link above $ajax->Exec("thing_{$row->id}",$ajax->call("/ajax/x_class/do_some_things/{$row->var1}/{$row->var2}")); endforeach; ?>
class x_class extends CI_Controller { function do_some_things($var1, $var2) { $ajax = ajax(); $vars['var1' = $var1; $vars['var2' = $var2; $ajax->overlayContent($this->load->view('your_form', $vars, true)); //your validation rules $rules = array(); //assuming your button id is 'btn_frm' $ajax->validate('btn_frm', '/ajax/x_class/handle_the_form',$rules); } function handle_the_form() { $ajax = ajax(); //debug to see the data posted.. $ajax->dialog('<pre>'.print_r($_POST,1)).'</pre>','Form Data'); } }