Changes for page Form Builder

Last modified by Sachin Patil on 2024/08/30 07:28

From version 16.1
edited by rijo
on 2022/12/07 06:21
Change comment: introduced heading for the Extra Script/Style sample code; introduced sample code for hidding options in form
To version 17.1
edited by rijo
on 2022/12/07 06:52
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -502,7 +502,7 @@
502 502  
503 503  = ADVANCED FORM TECHNIQUES: =
504 504  
505 -With Extra Scripts/Extra Styles, you can add features to your form or popup to enhance its look-and-feel as well as features.  Following are examples of how this can be achieved.
505 +With Extra Scripts/Extra Styles, you can add features to your form or popup to enhance its look-and-feel as well as operations.  Following are examples of how this can be achieved.
506 506  
507 507  \\
508 508  
... ... @@ -585,28 +585,28 @@
585 585  
586 586  \\
587 587  
588 -**Example:** A form contains a collection of questions.  If the need to get rid of a question or option, you may want to have it removed.  You can make this field invisible without changing anything else about the form, using the Extra Script option.  Without re-designing the form, we are able to remove the unwanted option by using the sample code below. 
588 +**Example:** A form contains a collection of questions.  The client decides that a question/option needs to be done away with, but without disturbing the rest of the form. You want to have it removed or hidden.  You can make this field invisible without changing anything else about the form, using the Extra Script option.  Without re-designing the form, we are able to remove the unwanted option by using the sample code below. 
589 589  
590 590  \\
591 591  
592 592  **Example Sample Code:**
593 593  
594 -(% class="p1" style="" %)
594 +(% class="p1" %)
595 595  var removeId = document.getElementsByClassName("labelId");
596 596  
597 -(% class="p1" style="" %)
597 +(% class="p1" %)
598 598  for(var i = 0; i < removeId.length; i++){
599 599  
600 -(% class="p1" style="" %)
600 +(% class="p1" %)
601 601  if(removeId[i].innerText(% class="apple-converted-space" %)  (%%)== "RemoveMePlaceHolder"){
602 602  
603 -(% class="p1" style="" %)
603 +(% class="p1" %)
604 604  removeId[i].parentNode.style.display="none";
605 605  
606 -(% class="p1" style="" %)
606 +(% class="p1" %)
607 607  }
608 608  
609 -(% class="p1" style="" %)
609 +(% class="p1" %)
610 610  }~/~/end of for loop
611 611  
612 612  \\
... ... @@ -614,24 +614,24 @@
614 614  **Steps:**
615 615  
616 616  * Initialize a variable to grab all the instances of the id from the form you want hidden. 
617 -** var removeId = document.getElementsByClassName("labelId");
618 -** removeId: name of variable (you can choose a name of your choice, but remember to be consistent with the use through the code)
617 +** var removeId = document.getElementsByClassName("labelId"); //(notice the semi-color)//
618 +** removeId: name of variable (//you can choose a name of your choice, but remember to be consistent with the use through the code//)
619 619  ** labelId: replace this with the id of the field you want checked/removed
620 620  ** getElementsByClassName: property of javascript that allows you to get elements by the class name property
621 621  * Traverse through the array of the gathered instances (of removeId), and check for the corresponding text by comparing the innerText property to  "RemoveMePlaceHolder"
622 -** removeId[i].innerText(% class="apple-converted-space" %)  (%%)== "RemoveMePlaceHolder" (check for matches)
622 +** removeId[i].innerText(% class="apple-converted-space" %)  (%%)== "RemoveMePlaceHolder" (//check for matches//)
623 623  ** RemoveMePlaceHolder: replace this with the text you want hidden
624 624  * If a match is found, then grab its parentNode
625 625  ** removeId[i].parentNode
626 -** i is the index of the array where the match was found
626 +** [i] is the index of the array where the match was found, during traversal
627 627  * Change the style of the parentNode to display it as none.  This keeps the field hidden in your forms.
628 -** removeId[i].parentNode.style.display="none";
628 +** removeId[i].parentNode.style.display="none"; (//notice the semi-color//)
629 629  
630 630  \\
631 631  
632 632  **Note:**
633 633  
634 -* All the code must be included in form extra script area.
634 +* All the code must be included in the form Extra Script field.
635 635  * The code is to be inserted in the forms in which the value need not been shown or hidden
636 636  
637 637  = DYNAMIC/PROGRESSIVE LOOK-UP: =
Confluence.Code.ConfluencePageClass[0]
id
... ... @@ -1,1 +1,1 @@
1 -77496616
1 +77496878
url
... ... @@ -1,1 +1,1 @@
1 -https://info.onecount.net//wiki/spaces/OD/pages/77496616/Copy of New Form Builder
1 +https://info.onecount.net//wiki/spaces/OD/pages/77496878/Copy of New Form Builder