+ Start a Discussion
Gheorghe SimaGheorghe Sima 

Popup window

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 anyone explain me how to do this? (In Save method if email and phone are not introduced I put a text in the  Email field to pass the validation rule)
Vishal Negandhi 16Vishal Negandhi 16
If you understand javascript, you can simply use the confirm box in javascript. HTML Example here:

You just need to capture the email and phone fields in your javascript code, if they are blank show this message to user and for the other case, call your controller method to save the data.