Reputation: 39
I am using reactjs-form-builder
for generating forms in react js my fields object is
this.state = {
id: null,
loading: true,
fields: {
"fields": {
"name": {
'label': "Product Name",
"type": "text",
"required": true,
"placeholder": true,
}
"submit": {
"type": "submit",
"label": "Edit Product",
"color": "btn-primary",
}
}
}
};
How do i set value to field name.
Upvotes: 1
Views: 283
Reputation: 320
Just add value
in you field object.
"name": {
'label': "Product Name",
"type": "text",
"required": true,
"placeholder": true,
"value": "You value here",
}
Upvotes: 1