Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: creating two set of radio groups using Javascript  (Read 5114 times)

ccxxzz

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
creating two set of radio groups using Javascript
« on: February 09, 2019, 06:17:29 AM »

Hello all,

I am trying to create two set of radio groups in my stamp using Javascript, however, when I copied code from the original radio group to the next one, it's not working. Can any one help me with this? Thanks a lot!!! I pasted my code here.

var builder =
{
   // These map to Text Fields in the Stamp
   textBoxes :
   [
      { field:"Arch", description:"Arch:", default:function() { return Collab.user; } },
                { field:"Mech", description:"Mech:", default:function() { return ""; } },   
                { field:"Struct", description:"Struct:", default:function() { return ""; } },   
                { field:"Elect", description:"Elect:", default:function() { return ""; } },
                { field:"Civil", description:"Civil:", default:function() { return ""; } },
                { field:"Civil", description:"Design:", default:function() { return ""; } },
                { field:"By", description:"By:", default:function() { return ""; } },
      { field:"Date", description:"Date:", default:function()
         { 
            var curDate = new Date();
            return (curDate.getMonth() + 1) + "/" + curDate.getDate() + "/" + curDate.getFullYear();
         }
      },
                { field:"Countersigned By", description:"Countersigned By:", default:function() { return ""; } },
      { field:"Countersigned Date", description:"Countersigned Date:", default:function()
         { 
            var curDate = new Date();
            return (curDate.getMonth() + 1) + "/" + curDate.getDate() + "/" + curDate.getFullYear();
         }
      },
      { field:"Spec. Section", description:"Spec. Section:", default:function() { return ""; } },
                { field:"File No.", description:"File No.:", default:function() { return ""; } },
      { field:"Submittal No.", description:"Submittal No.:", default:function() { return ""; } }            
   ],
   // This maps to a Radio Group in the PDF named 'Status'
   radioGroup : "Status",   
   radioButtons :
   [
      // value maps to the 'Choice' of each radio button in the group, description will show on the dialog
      { value:"Approved", description:"Approved" },   
      { value:"Approved As Noted", description:"Approved As Noted" },
      { value:"Rejected", description:"Rejected" },
                { value:"Revise And Resubmit", description:"Revise And Resubmit" }
   ],
   radioErrorMsg : "Please select a status"
                // This maps to a Radio Group in the PDF named 'Information'
   radioGroup : "Information",   
   radioButtons :
   [
      // value maps to the 'Choice' of each radio button in the group, description will show on the dialog
      { value:"No comments", description:"No comments" },   
      { value:"Comments as noted", description:"Comments as noted" }
   ],
   radioErrorMsg : "Please select a status"
}
Logged

thecadwiz

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
Re: creating two set of radio groups using Javascript
« Reply #1 on: February 05, 2020, 12:25:22 PM »

Did You ever get an answer? 

 There is a "calculation" field added to the stamp which has a Javascript tied to it. This script sets up the structure for  the two groups "Status" and "Options". If you want to add another radio group, you must adjust the script in the "calculating" field.

I read this on BB help online....

The JavaScript in this stamp is actually split into two parts. There is the Global JavaScript that we already edited and there is a second part of JavaScript that is included in the Calculation form field. This field and its JavaScript are required for the stamp to work. This second half of the JavaScript has been written so that it does not need to be updated if radio buttons are added or removed from the Status set or if another text box field is added. Adding a new set of radio buttons, check boxes or other form fields will require that this JavaScript be adapted to accommodate them.

I am in the same boat. I would like to ad more groups but don't have the Javascript knowledge to do so.

Has anyone done this or know Javascript?

Thanks!
Logged