+ Start a Discussion
sreekanth reddysreekanth reddy 

How to send email if i selected radio button in vf page

Hello
in vf page 3 radio buttos is their if i select one radio button and click send button in page
it sends email to one user.
thanks.
 
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello,

Try something like this:

Your VF:
<apex:selectRadio value="{!selectedItem}">
<apex:selectOptions value="{!items}"/>
</apex:selectRadio>

Your Controller:
 
public List<SelectOption> items { get; set; }
public String selectedItem { get; set; }
[...] //fill up values

public void send()  {

   if (selectedItem == 'desiredSelection')  {
     // send email code
   }
}

There are other wyas to get the same desired result.

Regards

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.