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
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:
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_confirm2

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.