function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sreekanth reddysreekanth reddy 

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

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.
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior

Try something like this:

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

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.


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