0

I am new to jQuery can you help me. How to assign array input to assign another input value using jquery?

<tr>
    <td><label>Date</label><input type="date" name="PostingDate[]" id="date" style="text-align: center;"class="form-control " required /></td>
    <input type="date" style="display: none;" name="AddedOn" class="KR" />
</tr>
<script type="text/javascript">
    var date=$("#date").val();
    $(".KR").val(date);
</script>

want to assign the date to this input field.

10
  • Is their anyone know about this help me..
    – Krishnan R
    May 30, 2019 at 6:46
  • You are already assigning, now what help required?
    – Rahul
    May 30, 2019 at 6:50
  • Yes, i tried to print it shows nothing
    – Krishnan R
    May 30, 2019 at 6:51
  • How it will show, you keep it hidden already
    – Rahul
    May 30, 2019 at 6:51
  • Is it correct to allocate an array value to input box
    – Krishnan R
    May 30, 2019 at 6:51

1 Answer 1

0

You can try in this way:

    $('#date').on("change",function(){
         $(".KR").val($(this).val());
         $(".KR").show()
    })
1
  • If delete the code( $(".KR").show() ) it not inserted.
    – Krishnan R
    May 30, 2019 at 7:05

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.