You need to sign in to do that
Don't have an account?
Passing value from form/post into controller's IF
Greetings,
We need to kick off a function (send update e-mail) based upon the checkbox status of a checkbox on an Apex form/page. However, it doesn't seem to be working right... is my code correct? Thanks for suggestions!
Apex Page Code:
<br>Check to send colleagues a notification e-mail when I save:
<apex:inputCheckbox value="{!Sendmails}" id="emailvalue"/>
Relevant Apex Controller Code:
private string Sendmails;
public string getSendmails() {
return Sendmails; }
public void setSendmails(string v) { sendmails = v; }
...
public PageReference save()
{
if (sendMails == '1') {
try{ // code here }
}
}
Thanks again!
--Dave
All Answers
Ah -- all set. The value of an apex:inputCheckbox is True or False, not 0 or 1.
Thanks,
--Dave