Url not passing to form
Answered
rkstlohchab posted this in #help-forum
@Anay-208 can you tell whats going wrong
the cloudinary is not returning url but it is not passed in to the form
the cloudinary is not returning url but it is not passed in to the form
Answered by rkstlohchab
form.setValue("imageUrl", info.secure_url);
field.onChange(info.secure_url);
field.onChange(info.secure_url);
91 Replies
What happened to your previous thread
@rkstlohchab i closed it
You can reopen it
got help form somewhere else
@Anay-208 You can reopen it
no need now
Ok
yess brothr
@rkstlohchab <@755810867878297610> can you tell whats going wrong
the cloudinary is not returning url but it is not passed in to the form
It’s returning url as shown in the console
@rkstlohchab Click to see attachment
Doesn’t url work?
arey i want to say
url is getting upload but that url field is only for the link of program
but i am
returning the image link from cloudinary
in imageUrl
but it is not receiving it somehow
basically a problem with form data
New Zealand
ohh
@New Zealand ohh
can u help with the forms ?
New Zealand
try to use info.url
i am getting url from the cloudinary
but it is not updating inside the form
@rkstlohchab i am getting url from the cloudinary
You need to use info.url
New Zealand
maybe bcoz of path of url that u are specifying isn't correct
@Anay-208 You need to use info.url
i dont get it
where should i use info.url?
@Anay-208 You need to use info.url
i am getting data with info.secure_url
@rkstlohchab Click to see attachment
Replace imageUrl with url
New Zealand
u wrote setUploadedUrl(info.secure_url)
try setUploadedUrl(info.url)
try setUploadedUrl(info.url)
@New Zealand u wrote setUploadedUrl(info.secure_url)
try setUploadedUrl(info.url)
I think it should be info.secure_url.url
New Zealand
yeah bcoz its nested in another field
So it should work then
@rkstlohchab and there is the field secure_url
New Zealand
that is nested
@Anay-208 I think it should be info.secure_url.url
New Zealand
try this I think it should work
😭
man
u are wrong
info.secure_url.url is not even in the objecttt
@New Zealand
how can i even access the value
if it not even there
New Zealand
ohkiee then I am wrong
@Anay-208
Console log info
@Anay-208 console.log(info)
Now info.secure_url
@Anay-208
If you’re talking about react hook form, it’s because of the fact that the uploaded url is not being added to the form
You’ve not set up your things relating to react hook form/shadcn forms right
my widget
for the
forms
@Anay-208
yes
You need to fix these things
yep
@rkstlohchab Click to see attachment
It’s because you are doing it wrong
Check the docs
wait
lemme cross check
form.setValue("imageUrl", info.secure_url);
field.onChange(info.secure_url);
field.onChange(info.secure_url);
Answer
it worked using this
@Anay-208