You need to sign in to do that
Don't have an account?
Mona Lisa 9
when checkbox field is marked as true at that instant ,display an alert message(popup with some text) before pressing save button
I want to display an alert message at the instant when the checkbox is ticked. I had a VF code but the problem was- alert message display only after clicking standard save button. Plz, help me on this issue.
<apex:page standardController="Opportunity" rendered="{!(Opportunity.Forecast_Indicator__c)}">
<script type="text/javascript">
window.alert("Text");
</script>
</apex:page>
<apex:page standardController="Opportunity" rendered="{!(Opportunity.Forecast_Indicator__c)}">
<script type="text/javascript">
window.alert("Text");
</script>
</apex:page>
After looking your problem, I've created a sample code in my org that I am posting here.
<apex:page >
<script>
function f() {
alert("Text");
}
</script>
<apex:form>
<apex:inputCheckbox onclick="f()" />
</apex:form>
</apex:page>
Please mark it best answer if you find it helpful.
Thanks
All Answers
1) I think your approach is not working because the value of the check box is changed only once its saved. That is why you are getting the messgae after clicking save.
2) In the form where you have the check box field in that if you put onclick='alert('Text')'.
Hope it helps
RD
After looking your problem, I've created a sample code in my org that I am posting here.
<apex:page >
<script>
function f() {
alert("Text");
}
</script>
<apex:form>
<apex:inputCheckbox onclick="f()" />
</apex:form>
</apex:page>
Please mark it best answer if you find it helpful.
Thanks
Thanks in advance
Could you help me here please.
<apex:page standardController="Account" rendered="{!(Account.Active_Customer__C)}">
<script>
function f(confirmsave) {
alert("Text");
}
</script>
<apex:form>
<apex:inputCheckbox onclick="f(!save)" />
</apex:form>
</apex:page>