Hi folks,
I think I’m being stupid this morning but here goes… I have made an Admin form that is connected to a database for my site. I am trying to keep less experienced folks from using the WIX Editor. I want the user to be able to replace an image on my form with an image from a Board within the WIX Media Manager . How would I go about doing this?
Right now I only have the option to upload from my computer.
Thanks!
Sylvia
export function uploadButton1_change ( event ) {
if ( $w ( “#uploadButton1” ). value . length > 0 ) {
$w ( “#preloader1425” ). show ();
$w ( “#imageText” ). text = "Uploading " + $w ( “#uploadButton1” ). value [ 0 ]. name ;
// To prevent showing the previous image once a new one is uploaded
// $w(“#formImage”).src = “”;
$w ( "#uploadButton1" ). startUpload ()
. then (( uploadedFile ) => {
$w ( “#formImage” ). src = uploadedFile . url ;
$w ( “#imageText” ). text = “Upload successful” ;
})
. catch ( err => {
$w ( “#imageText” ). text = “File upload error” ;
console . log ( err , “Something went wrong” )
})
. finally (() => {
$w ( “#preloader1425” ). hide ();
$w ( “#imageText” ). text = “Upload successful” ;
})
} else {
// If the user clicks X on the upload button, reset the image to the default one
// $w(“#formImage”).src = defaultImage;
$w ( “#imageText” ). text = “Please choose a file to upload.” ;
}
}