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 3627036
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:50:15+00:00 2026-05-18T23:50:15+00:00

I have made a sortable list. Based on the order of the sortable list

  • 0

I have made a sortable list.

Based on the order of the sortable list i want to insert text into a textarea #notes.
is there anyway I can have text sorted based on the list so even if i change the order. the text in the textarea should change accordingly

eg

<ul>
<li>entry 1</li>
<li>entry 2</li>
</ul>


entry 1 = "this is line 1"
entry 2 = "this is line 2"

I am not sure if i have to use Ajax or something to have this done. since i want each list item to have predefinded text.

I am trying to learn Jquery and would really apprieciate any help.
any hints on how i can have this done.

Question

Where and how do i store these predefined values ?
How to get the text in the text area sorted ?

can someone please point me in the right directions

  • 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-18T23:50:16+00:00Added an answer on May 18, 2026 at 11:50 pm

    Maybe write a javascript function to refreshTextarea() that you will use initially to fill the textarea and every time the sorting changes it will “refresh” it by emptying and refilling depending on the sort order of the list.

    ok, to associate values with your list items, give your ul an id and your li unique ids

    <ul id="the-list">
        <li id="item-1">entry 1</li>
        ...
    </ul>
    

    then for each list item, create a hidden input with an id that corresponds in some way

    <input type="hidden" id="item-1-data" value="this is where you put info for the list item entry 1" />
    

    Then with jquery you programmatically associate them by looping through your list items and refreshing your textarea after any sort is made.

    $('#the-list li').each(function() {
        //get the id of the list's data field
        var li-data-id = $(this).attr("id") + '-data';
    
        // get the actual data associated with this list item
        var li-data = $(li-data-id).val();
    
        // append next list's data in the textarea
        $('#id-of-textarea').val($('#id-of-textarea').val() + "\n" + li-data)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list made as sortable using jQuery UI. The first list item
I have made a custom UserControl i Vb.net (windows application). How can I add
I have made a class which a form can inherit from and it handles
I have made a multiplayer game using the GameKit Framework where 2 iPhones/iPods can
I have made a form for client registration, and I can't make this postvalidators
I have a page using jQuery with some lists which have been made sortable.
I have made an normal form that you can enter a user´s fullname in
I have made an application that can render and save a given element. With
I have made a Linux CUI app that communicates between processes via Message-quene. There
Simple question about Jquery-UI sortable lists (http://jqueryui.com/demos/sortable/#default) I have made: <ul id=sortable> <li class=ui-state-default>An

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.