You need to sign in to do that
Don't have an account?
Gheorghe Sima 21
Popup message visualforce page
Hi,
I have a javascript code what shows me a popup message, but when i click cancel it execute me the action from the command button.
here is my code:
and here is the button declaration:
When I click Cancel on the popup window it execute me the action from the button and I don't want to do this. Can anyone help me?
I have a javascript code what shows me a popup message, but when i click cancel it execute me the action from the command button.
here is my code:
<script type="text/javascript"> function Verif(emailAddress, phone) { if(emailAddress == '' && phone == '') return confirm('Are you sure?'); return null; } </script>
and here is the button declaration:
<apex:commandButton action="{!save}" value="Save" onclick="Verif(document.getElementById('{!$Component.pb.pbs.pbsie.email}').value,document.getElementById('{!$Component.pb.pbs.pbsip.phone}').value );" />
When I click Cancel on the popup window it execute me the action from the button and I don't want to do this. Can anyone help me?
I have added a actionFunction in your VF page and also changed your JS function.
Please find the VF page below : Please modify your JS function and add a actionFunction in your VF page by taking help from above code.
Let me know if you have any issue with the above code or if you want more help on this.
Thanks,
Abhishek
All Answers
I have added a actionFunction in your VF page and also changed your JS function.
Please find the VF page below : Please modify your JS function and add a actionFunction in your VF page by taking help from above code.
Let me know if you have any issue with the above code or if you want more help on this.
Thanks,
Abhishek
First of all i apolozise for reaching you so late.
I am not able to figure out why it is not working for you.
It would be good if you can share your full code here so that i can help you.
In case of any emergency you can reach me at
Gmail : abhibansal2790@gmail.com
SkypeId : abhishek.bansal2790
Let me know if you need any other help.
Thanks,
Abhishek
I have a validation rule on Contact which don't let me make a Contact without Email or Phone number, but I have some cases when the user can create an Contact without email and Phone. I have a visualforce page to create a new contact and when the user click Save and he don't put the email or phone I want to show a popup window and ask him if he want for sure to create a contact without email or phone. Can you explain me how to do this?
I think this is something difeerent from the original question.
Please post this new question on another Developer Forum.
If you have any emergency please contact me personally on Gmail or Skype (I have already provided the Ids in above reply).
If you want solution on Developer Forum than Please create a new question and send me the link here.
I will definitely reach you out there and provide you all the possible help.
Thanks,
Abhishek
here is the link for the new question and below is my page: