-4

i'm have some values to fill in the text box. In input text box. It contains multidimensional array so how can i set value using jquery.

    <input 
        type="text"
        id="kvtabform1-1-score" 
        class="form-control" 
        name="kvTabForm1[1][Score]" 
        autocomplete="off"/>
5
  • 1
    Please show what you tried implementing Commented Jan 4, 2019 at 5:28
  • i want to fill value to the text box using jquery, But it contains multi-dimensional array. Commented Jan 4, 2019 at 5:29
  • Possible duplicate of stackoverflow.com/questions/35696140/… Commented Jan 4, 2019 at 5:30
  • $("input:text").val(kvTabForm1[1][Score]); try this if this works Commented Jan 4, 2019 at 5:31
  • 1
    Why not take the a tour to the world of documentation ..? Makes good for @ShubhamJain too ... Commented Jan 4, 2019 at 5:33

1 Answer 1

0

Using starts with selector

$('[name^="kvTabForm1"]').each(function() {
    $(this).val('hello')
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" id="kvtabform1-1-score" class="form-control" name="kvTabForm1[1][Score]" autocomplete="off">

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

Comments

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.