0

Why after a click on add, adding several input together?
I want once times add input in each click on add.
you see yourself : my code

2
  • Are you looking to add a new input, a new .mediumCell or a .column? Commented Jul 23, 2011 at 21:02
  • Yes, everything in between classes '.adding', '.ai_service' Commented Jul 23, 2011 at 21:05

3 Answers 3

1

Try this js fiddle I think I have done wat you wanted.

http://jsfiddle.net/539LR/6/

Here is the js code

$('a.add_input').live('click', function (e) {
    e.preventDefault();
    var $column = $(this).closest("div.column");
    var input = $column.prev("div.column").clone().wrap("<div />").parent().html();
    $column.before($(input));

});
Sign up to request clarification or add additional context in comments.

2 Comments

after click on add several input together adding . Here you can put the code?
I am sorry the link which I pasted was wrong. Please check my edited answer it has the right link as well as the code too.
1

This is probably what you want. It grabs a column, duplicates it, sets the input to "" and inserts it before the "add" button

http://jsfiddle.net/n4YFK/1/

Comments

0

Use var input = $(".ai_service").find(":eq(0)").html(); instead. See http://jsfiddle.net/539LR/4/ for reference

3 Comments

no, i not want adding 1 input(it is Unlimited ), i want with each times click add 1 input in class input that clicked.
then you should remove $(this).remove() from the script, because it removes the add link jsfiddle.net/539LR/5
my problem not remove add input, my problem is: after a click on add, adding several input together

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.