Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

HTML
<script>
  function showValueFunc(formName, formId) {
    // never execute it in edit mode
    if (AJS.$('#wysiwygTextarea_ifr').length === 0isPageViewMode()) {
      alert(AJS.$(formName).find('#i_myvalue').val());
    }
  }

  function setValueFunc(formName, formId) {
   if (isPageViewMode()) {
     AJS.$(formName).find('#i_valueToBeSet').val(AJS.$(formName).find('#i_myvalue').val());
   }
  }

  function isPageViewMode() {
   return AJS.$('#wysiwygTextarea_ifr').length === 0;
  }

</script>