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

  • Home
  • SEARCH
  • 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 524403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:33:52+00:00 2026-05-13T08:33:52+00:00

This should be my last question on Jquery Sortable…for a while :) I have

  • 0

This should be my last question on Jquery Sortable…for a while 🙂

I have a list that I’m able to remove elements from dynamically. when users click the X close box on the element, I get the parent (the element itself) and remove it:

    function DeleteLink() {
        var jItem = $(this).parent();

        var LinkId = jItem[0].childNodes[1].innerText || jItem[0].childNodes[3].textContent;
        var LinkTitle = jItem[0].childNodes[2].innerText || jItem[0].childNodes[5].textContent;

        if (!confirm(String.format("Are you sure you want to delete link #{0}?\n\nTitle: {1}", LinkId, LinkTitle)))
            return;

        jItem.remove();
        $.post("/Home/DeleteLink/" + LinkId);
        showStatus("Link deleted...", 5000);
    }

If you are interested, unordered list is created like this:

<ul id="sortable1" class="connectedSortable">
        <% foreach (Link l in Model)
             {
                 if (l.Visible == true)
                 {%>
                    <li class="photolistitem" style="min-height:50px;">
                    <div class="imagecontainer"><img src="/Content/images/link.jpg" style="float:left; padding-right:5px;" class="thumbnailimage" alt="" /></div>
                    <div id='<%=l.Id%>Id'><%=l.Id%></div>
                    <div id='<%=l.Id%>Description'><%=l.Title%></div>
                    <div id='<%=l.Id%>Description'><%=l.Description%></div>
                    <div id='<%=l.Id%>Description'><%=l.Url%></div>
                    <div class='deletethumbnail'>X</div>
                    </li>
               <%}%>
       <%}%>  
    </ul>

What I want to do is to have a form on the bottom of the page so that a user can add an element dynamically – They will only need to insert a description, a title, and a url (I will use another jquery plugin to validate the input).

I think the biggest challenge will be dynamically creating an object that can be appended to the list. Can anyone point me in the right direction for this?

  • 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-13T08:33:52+00:00Added an answer on May 13, 2026 at 8:33 am

    jQuery

    thisDependant = $('.DependantTemplate').clone();
    $(thisDependant).removeClass("DependantTemplate");
    $(thisDependant).addClass("Dependant" + dependantNum);
    $('.DependantList').append(thisDependant);
    

    HTML

    <div class="DependantTemplate hidden">
      <div style="float:left;" class="DependantNumber spacerRight10"></div>
      <div style="float:left;" class="DependantFirstName spacerRight10"></div>
      <div style="float:left;" class="DependantLastName spacerRight10"></div>
      <div style="float:left;" class="DependantDateOfBirth spacerRight10"></div>
      <div style="float:left;" class="DependantGender spacerRight10"></div>
      <div style="float:left;" class="DependantType"></div>
      <div class="clearFloats"></div>
    </div>
    
    <div class="DependantList"></div>
    

    The above is what I use to do the same as you’re looking for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 303k
  • Answers 303k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you are looking for hardware information try using getDeviceId().… May 13, 2026 at 8:37 pm
  • Editorial Team
    Editorial Team added an answer I asked the same question a few months back and… May 13, 2026 at 8:37 pm
  • Editorial Team
    Editorial Team added an answer Can't you simply create a trigger without actually executing it?… May 13, 2026 at 8:36 pm

Related Questions

Thanks for your help on my last noobie jquery question and since you done
Having a bit of a hairy issue when submitting data over a jquery ajax
I'm trying to develop a simple management system for press releases for my company
I've tried finding an understandable answer to this, but given up. In order to
I have controller action which returns JsonResult and is consumed by jquery ajax get

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.