$(function(){
    $('.question').css('display', 'none');

    $(document).ready(function(){
        var question_no = '#q-' + q_no;
        $(question_no).css('display', 'block');
    });

    $('button[next]').button().click(function(){
        var this_id     = this.id;
        var id_array    = this_id.split('-');
        var id          = id_array[1];
        var next        = +id+1;
        var this_q      = '#q-' + id;
        var next_q      = '#q-' + next;

        $(this_q).css('display', 'none');
        $(next_q).css('display', 'block');

        $.ajax({
            type: 'post',
            url: base_url + 'index.php/survey/register_q_no_session',
            data: {'q_no':id},

            success: function(data) {

            }
        });

    });

    $('button[pre]').button().click(function(){
        var this_id     = this.id;
        var id_array    = this_id.split('-');
        var id          = id_array[1];
        var pre        = +id-1;
        var this_q      = '#q-' + id;
        var pre_q      = '#q-' + pre;

        $(this_q).css('display', 'none');
        $(pre_q).css('display', 'block');

        $.ajax({
            type: 'post',
            url: base_url + 'index.php/survey/register_q_no_session',
            data: {'q_no':id},

            success: function(data) {

            }
        });

    });
});
@@ -680,34 +680,36 @@
   data: %7B'q_no':
-id
+next
 %7D,%0A%0A            
@@ -1272,18 +1272,19 @@
 %7B'q_no':
-id
+pre
 %7D,%0A%0A    

store q no to session via ajax