Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

66
Views
How do i pass a javascript object in an input feild

hello i am trying to map items stored in my redux into a form . I created a component called PAYMENT.js that gives a format of how the item should be arranged THIS IS A REACT PROJECT

PAYMENT.JS

import React from "react";

function Payment({ name, price, count, itemSize }) {

  return (
    <div>
      <p> {name}, {itemSize}, {count} </p>
    </div>
  );
}

export default Payment;

I want it to be mapped in an input feild , this feild would be readable .

Here is it

<div class="telephone">
                <label for="name"></label>
                <input
                  className="payment_form"
                  type="text"
                  placeholder="My address"
                  name="telephone"
                  value={items.map((item, id) => (
                    <Payment
                      id={items.id}
                      key={id}
                      name={item.name}
                      price={item.price}
                      size={item.size}
                      image1={item.image1}
                      itemSize={item.itemSize}
                      count={item.count}
                    />
                  ))}
                  id="telephone_input"
                  required
                />
              </div>

i get [OBJECT , OBJECT ][OBJECT , OBJECT ] Instead of the actual object . Putting the map function in a p tag and iget the value of the items in the redux

<p>
                {" "}
                {items.map((item, id) => (
                  <Payment
                    id={items.id}
                    key={id}
                    name={item.name}
                    price={item.price}
                    size={item.size}
                    image1={item.image1}
                    itemSize={item.itemSize}
                    count={item.count}
                  />
                ))}
              </p>

OUTPUT Von dutch pink, Xtra large, 1

Von dutch camoeo, Xtra large, 2

Von dutch pink, Xtra large, 3

I want this out put to show in the input feild so i can send it over

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

note that you should not give the attribute "value" an array value because a value attribute must be a string

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!