Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7003621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:05:34+00:00 2026-05-27T21:05:34+00:00

i have a form and a sortable() list where a user can drag from

  • 0

i have a form and a sortable() list where a user can drag from a pre populated list, into an empty UL. The user would drag the LIs that they want into to this empty UL.. There is also a form with a few text boxes that the user fills out and clicks submit.

I can get the ajaxform to submit the form data and display it in a flashdata session, but i cant get it to show the allowed_fields data. (which is the sortable list). I know its serializing it because running alert(serializedList); returns the serialized list of elements.

This is the JS to generate the sortable lists:

/**
 * sortable ul items
 * 
 * this is used for the add levels page to associate allowed_fields 
 * to a level.
 */
$('.block-list').sortable({
    connectWith: '.block-list',
    placeholder: 'placeholder'
});

This is the JS to process the ajaxSubmit:

/**
 * showResponse(data)
 * show the response if the form submission is successful
 * @param  {object} data object of message or success
 * @return {null}
 */
function showResponse(data){
    alert(serializedList);
    if (data.errorStatus == 1){
        $.jGrowl(data.message, { theme: 'error' });
    }else{

        $.jGrowl(data.message, { theme: 'success' });
    }
}//end showResponse()

/** @type {Object} setup the options for the ajax submit forms. */
var submitOptions = {
    success: showResponse,
    beforeSubmit: function(){ serializedList = $("#allowed-fields-list").sortable('serialize');  },
    dataType: 'json',
    resetForm: true ,
    data: { allowed_fields: serializedList }
};      
$("#addlevel-form").ajaxForm(submitOptions);

and this is the code igniter function that will handle the form data..

public function addlevelprocess(){
    $message = array(
        'message' => 'Successfully Added The Level To The Database! WHOA!:'.$this->input->post(),
        'errorStatus' => 0
    );
    $this->session->set_flashdata('post', $this->input->post());
    echo json_encode($message);
}

how can i get ajaxform to send both form field data and the sortables() data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:05:35+00:00Added an answer on May 27, 2026 at 9:05 pm

    i ended up using ajaxSubmit() and passing the serialized form information via data:

    $('#addlevel-form').submit(function() {
        /** @type {serialized} serialized array of field IDs for allowed fields */
        var allowedFields = $('#allowed-fields-list').sortable('serialize');
        var formInfo = $('#addlevel-form').formSerialize();
        /** @type {Object} setup the options for the ajax submit forms. */
        var submitOptions = {
            url: '/admin/levels/addlevelprocess.html',
            dataType: 'json',
            success: showResponse,
            data: { allowed_fields: allowedFields, levelInfo: formInfo }
        };      
        $(this).ajaxSubmit(submitOptions);
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have form where user submits field. Field can have letters, numbers, and punctuation.
I currently have form that checks if a user has unsubmitted changes when they
I have list items in an unordered list that when double clicked, can be
I have a form that generates sortable divs. I am using .append() and .html()
I have a form that generates a sortable div. I have added a div
I have an unordered list of form elements with ids <ul class=sortable id=userForm> <li
I have form that displays several keywords (standard set of choice lists that changes
I have form with user defined filters ( combobox with column names, combobox with
I have form, where some fields are looks like rows, so I can add/delete
I have a table that shows a list of events, each event also has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.