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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:24:01+00:00 2026-06-08T17:24:01+00:00

to get more than what you expect may be nice on your birthday –

  • 0

to get more than what you expect may be nice on your birthday – but this in script drives you crazy… 🙁

i’ve got the following code:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="../scripts/jquery-ui.min.js"></script>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <div id="id1" class="fragenMainDiv" style="width: 80%; margin: 0px;">
    <input type="button" id="id1_edit" class="editIcon" value="change">
    <span id="id1_Label" class="fragenLabel">
    <p>
    <span style="margin-left:5px;">
    <b>something</b>
    </span>
    </p>
    </span>
    </div>
    </div>
    </form>
    </body>

    <script type="text/javascript">


    $(document).ready(function () {
    showMain();
    });
    function showMain() {

    $('.editIcon').css("cursor", "pointer").click(function () {
    edit($(this).attr("id"));
    });

    $('.editfinish').css("cursor", "pointer").click(function () {
    editFinish($(this).attr("id"));
    });
    }

    function edit(idTemp) {
    //alert(fragenidTemp);
    var IdArray = idTemp.split("_");
    var Id = IdArray[0]
    var inputValue = $('div[id|="' + Id + '"]').children("span").children("p").children("span").children("b").text();
    $('div[id|="' + Id + '"]').children("span").children("p").children("span").children("b").remove();
    $('div[id|="' + Id + '"]').children("span").children("p").children("span:first").append("<input id=input" + Id + " type=text size=70 style=margin-left:4px;></input><input type=button id=" + Id + " class=editfinish value=change />");

    $('input[id|="input' + Id + '"]').val(inputValue);
    $('.editIcon').hide();
    showMain();
    }


    function editFinish(Id) {
    var inhaltFrage = $('input[id|="input' + Id + '"]').val();
    $('.editIcon').show();
    $('div[id|="' + Id + '"]').children("span").children("p").children("span:first").children("input").remove();
    $('div[id|="' + Id + '"]').children("span").children("p").children("span:first").children("img").remove();
    $('div[id|="' + Id + '"]').children("span").children("p").children("span:first").append("<b>" + inhaltFrage + "</b>");

    showMain();
    }

    </script>

    </html>

what I want is an input field that reacts like a normal input field – but after the first (correct) change of value the form shows three times the input field…

Does someone have an idea? As it is a condensed script of a larger script so I need the structure of functions. Thanks for your help 🙂

  • 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-06-08T17:24:02+00:00Added an answer on June 8, 2026 at 5:24 pm

    Argghhh I finally found it. Dude you cannot use show main after every edit and editFinish. Becuse you are stacking several same event to one click ! The code shoul look like this :

    function edit(idTemp) {
        //alert(fragenidTemp);
        var IdArray = idTemp.split("_");
        var Id = IdArray[0]
        var inputValue = $('div[id|="' + Id + '"]').children("span").children("p").children("span").children("b").text();
        $('div[id|="' + Id + '"]').children("span").children("p").children("span").children("b").remove();
        $('div[id|="' + Id + '"]').children("span").children("p").children("span:first").append("<input id=input" + Id + " type=text size=70 style=margin-left:4px;></input><input type=button id=" + Id + " class=editfinish value=change />");
    
        $('input[id|="input' + Id + '"]').val(inputValue);
        $('.editIcon').hide();
         $('.editfinish').css("cursor", "pointer").click(function () {
        editFinish($(this).attr("id"));
        });
        }
    
    
        function editFinish(Id) {
        var inhaltFrage = $('input[id|="input' + Id + '"]').val();
        $('.editIcon').show();
        $('div[id|="' + Id + '"]').children("span").children("p").children("span:first").children("input").remove();
        $('div[id|="' + Id + '"]').children("span").children("p").children("span:first").children("img").remove();
        $('div[id|="' + Id + '"]').children("span").children("p").children("span:first").append("<b>" + inhaltFrage + "</b>");    }
    

    Hope that you see the error now, if not i can explain in detail.

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

Sidebar

Related Questions

Probably I cant get more dumb, but seriously this is the first time I
This question has been asked more than once before, but I have not found
why when table.Count = 1 table iteration functions get more than 1 key-value pairs?
Django's get_or_create function always cause get() returned more than one Model name error in
I need to get one set of rows (it will be more than 70k
Hello guys i try to get an object global/persistent over more than one php
I'm trying to get an Excel function to return more arguments than are passed
Okay so I'm struggling more than I should with this. I've been to the
I know, variations of this question had been asked before. But my case may
As I get more into RESTful APIs, the (good) simplicity of the approach means

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.