‘Dynamics Forms’ module from Data Springs,is a very user-friendly DNN module. It is used to create forms for marketing, sales, contact forms, scheduling, information requests, surveys etc. One of it’s very important feature is options for obtaining totals using client-side calculations. Suppose we created a form and want to associate a fixed point with various options of each question.And we want a dynamic calculation simultaneously as the user selects or enters a value.
Here is the solution.
A variety of field types can be used including radio buttons, dropdowns, and checkbox lists. At the end of the form, we will obtain a grand total, summing up totals obtained from each section. The value of each option can be set in the advanced field setting of the field.
1. We add some questions with radio buttons options as answer.
2.Add a hidden field for each of the added question.
3.Set default value of the hidden filed to zero and give a name in the “Short Name” field of the hidden field.This name will be used during calculation.
4.The basic logic is that,at the time of answer selection of a question the point associated with the option is saved into the corresponding hidden field of that
question.eg. agegroup ——-> short name of the question
hAgeGroup —-> short name of the hidden field of the question
hTotal ——-> short name of the hidden field to store the dynamic calculation value .
hGender ,hBorn,hEthinicity……….. —-> these are the short name of the hidden fields of other questions of the form.
total —–> it’s the ID of the Text/HTML field which is used to display the total calculation dynamically with the selection of options tio the questions.
CODE TO BE WRITTEN IN THE CLIENT SIDE EVENT FIELD OF EACH QUESTION(here for example question is having answers in form of radio button list)