0

I have error when I tried to set input values with an Array. I got this error messages when I set the value directly.

Array to string conversion

I tried to do two methods but got same error.

First method :

<input type="hidden" id="itemDetail" name="itemDetail" value="<?=$itemDetail?>">

Second method :

<script type="text/javascript">
    $('[name=itemDetail]').val(<?=$itemDetail?>);
</script>

How to set an array inside the input values ? Thank you.

Antonio
  • 755
  • 4
  • 14
  • 35
  • In its raw form, you can't. You will need to redefine your requirements. Not enough info to help you. – mickmackusa Jun 02 '20 at 08:17
  • Because this question has been asked a hundred times before and your question lacks clarity as well. This question will invite low quality answers to Stack Overflow. – mickmackusa Jun 02 '20 at 08:24
  • New duplicate after you clarified your intention via comment on the now deleted answer. – mickmackusa Jun 02 '20 at 08:32

0 Answers0