1

Here splitValues contains array and .split is a class in multiline texbox which is generated dynamically now i want fill the textbox with this array. I have done this much but not getting further?

function InsertItems(splitValues) {
    $(".split").each(function () {           
        if (splitValues != "") {
            $(this).val(splitValues);//
        }
    });
}
1
  • how many textbox do you have?? Commented Dec 16, 2014 at 7:22

1 Answer 1

2

change this:

$(this).val(splitValues);//

to this:

$(this).val(splitValues.join());//

Updates:

$(".split").each(function (i, elem) {           
     $(this).val(splitValues[i]);//
});

Updated Demo as suggested by Milind.

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

2 Comments

@Milind i want each array values to fill in single textbox?
@jai when i use join it put the whole array collection in each textbox

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.