5

How can I dynamically display a popup, based on a checkbox, on a page when it loads?

Requirement:

  • Application Object
    • Field - testchk which is a checkBox field.

When the Visualforce page loads, if testchk checkbox is not checked in the queried application, then display pop up with a checkbox and submit button. Else display the page.

5

If you are writing javascript code directly on VF page in you can do something like: Write it in end of your VF page.

<script>

if({!myObjectReference.myField}) // return true or false, also try {!myObjectReference.myField == true}
{
   dsplayPage(); // or do nothing
}
else
{
  displayPopup(); // popup logic is in this method
}
<script>

To show a popup Jquery modal dialogue can be helpful also here you can find required popup to show and its implementation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.