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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:46:12+00:00 2026-05-30T18:46:12+00:00

I have replaced chosen replaced and inserted dom elements this way: $(.editLink).click(function () {

  • 0

I have replaced chosen replaced and inserted dom elements this way:

$(".editLink").click(function () {
    var $temp = $(".editLink").parent().prev().find("label").html();

    var $tempBox = $(".editLink").parent().prev().find("label").replaceWith("<input type='text' name='dataUpdate'/>");

    $tempBox.insertAfter("<input type='submit' value='Update'/>");
});

However, changes flicker,..and dont persist. They only persist for one second..(I guess only for the time of the event. How can I make them persist forever ?

UPDATE:

<table width="400px">
<form action="/Admin/Update?Length=4" method="post">
<tr>
    <td>
        <label for="fadsf">
            fadsf</label>
    </td>
    <td>
        <a class="editLink" href="/Admin/MenuManagement?Length=5">Edit</a>
    </td>
    <td>
        <a class="deleteLink" data-ajax="true" data-ajax-mode="replace" data-ajax-update="#1"
            href="/Admin/Delete?deleteID=1&amp;unDelete=1" id="1" title="0">Delete</a>
    </td>
</tr>
</form>

  • 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-30T18:46:14+00:00Added an answer on May 30, 2026 at 6:46 pm

    I’ll guess you suggest they only persist for the time of the event because you are binding to an <a> tag which causes the page to reload or navigate somewhere else. You need to prevent that default behavior like so:

    $(".editLink").click(function (e) {
       ... other code
    
       $(e).preventDefault();
    
       ... other code
    });
    

    And the documentation – https://developer.mozilla.org/en/DOM/event.preventDefault

    UPDATE – Based on the HTML you have now provided

    Your HTML does not look valid. You cannot nest a form tag in between a table tag and a tr tag and expect it to work. First off, move the form tag outside of the table. Secondly, close the table with a matching </table> tag. Maybe that will help.

    Hope this helps!

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

Sidebar

Related Questions

Please help me to prevent my data from SQL injection. I have replaced '
I have a div with is replaced upon certain user actions. These actions are
I have a large text template which needs tokenized sections replaced by other text.
I have a piece of code with a) which I replaced with b) purely
I have a dotx file which contains placeholders to be replaced with DB values
I have a few questions: Why was a.out replaced by ELF ? What were
I have some JPG files that need to be replaced at runtime with a
I have to enable all the text in a winforms application to be replaced;
I have a localization issue. One of my industrious coworkers has replaced all the
I have to replace the content of this xml string through java <My:tag>value_1 22&#xA;value_2

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.