Question- Please help!

Hello, I am trying to create a page in my site which only I can access- I protected it.
I have 3 collections: FIRST, SECOND and THIRD.
In that page I have 3 radio buttons named accordingly to the collections.
Also, I have an upload image form.
What I want to happen is that if I click on the FIRST radio button, and then upload the image it will be joined to the FIRST collection. how can I make such a connection?

Thank you very much, I am trying to figure it out for the last 5 hours.

you have to have “if” statement with your “onclick” function…
see https://www.wix.com/corvid/reference/$w.RadioButtonGroup.html#options
something like this:

$w("#myRadioGroup").options = [
  {"label": "First", "value": "first"},
  {"label": "Second", "value": "second"},
  {"label": "Third", "value": "third"}
];

 export function upload_click(event) {
 if ($w("#myRadioGroup").value = "first_value) {
 add code for adding your info to the relevant collection;
    }
 if ($w("#myRadioGroup").value = "second_value) {  add code for adding your info to the relevant collection;   
   }    
  if ($w("#myRadioGroup").value = "third_value) {  add code for adding your info to the relevant collection;     
  }
}

I think this should work… hope it helps

I will try it and update you.
Thank you very much.

I decided to simply have 3 different buttons, one for each collection.
But now I encountered a new problem: Do you know how can I upload several images at once?

check out this post
https://www.wix.com/corvid/forum/community-discussion/solved-uploading-multiple-files-to-database

I saw this post, he uses 3 different buttons.
It is not what I want.
I want one button that aloows uploading several images.

@lironsl10 as far as I am aware, it is not possible to do with wix code