Power Pages Tip

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025
  • In this tip, I look at the JavaScript required to conditionally hide or show fields on a Power Pages form.

ความคิดเห็น • 5

  • @DibutilFtalat
    @DibutilFtalat ปีที่แล้ว +4

    Just a word of warning. Yesterday I had an issue with the page that had a form with steps auto-generated from tabs. On such page document.ready function causes a failure when submitting from the first to the next step. I did not dig deep but in general they recommend checking condition if page is post-back and then executing the script. I wanted the script executed on each step, so iInstead, I switched document.ready to document.addEventListener('DOMContentLoaded', function() {... This works fine on all pages including post-back type.

    • @EngineeredCode
      @EngineeredCode  ปีที่แล้ว +1

      Thanks for sharing this!

    • @Deepesh888
      @Deepesh888 6 หลายเดือนก่อน

      Quick question - what if the field that we hide is required if it was visible. The validation still fires when the field is hidden.

    • @DibutilFtalat
      @DibutilFtalat 6 หลายเดือนก่อน

      @@Deepesh888 you need to find and remove the validator for this field (in fact, there may be more than one validator per field, just beware) from validators collection on the page, then it will let the hidden field through.

  • @youngyingyang
    @youngyingyang 3 หลายเดือนก่อน +1

    Using Jquery to simply add a condition to hide/show a field is far from low/no code simplicity. Power Pages is not user friendly enough yet to compete with WordPress or other web site platforms yet, like Wix, etc... too bad.