Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

the page is not going forward

Hi, I used this code and designed constant sum scale with two columns..the code works..but page is not moving...
asked Jun 22, 2012 by anonymous

1 Answer

+1 vote
Is it bringing up any error text?  If it won't move to the next question there must be something not set right in the custom javascript verification area.  To check that, just uncheck the box on that tab so it doesn't call that script up.  If it moves forward then that's where the issue.  I'd be happy to look over what you have.
answered Jun 22, 2012 by Jay Rutherford Platinum (51,195 points)
This question has two columns one is for "Current" and second is for "Future" So you will see code for two columns. Each column should add up to 100.

Here is the Custom JavaScript verification code (i have selected After). If I selected Before, it shows Total must be 100 error

<script type="text/javascript">

var var11=SSI_GetValue ("SF9_C11")
var var12=SSI_GetValue ("SF9_C12")
var var13=SSI_GetValue ("SF9_C13")
var var14=SSI_GetValue ("SF9_C14")
var var15=SSI_GetValue ("SF9_C15")
var var16=SSI_GetValue ("SF9_C16")
var var17=SSI_GetValue ("SF9_C17")
var var18=SSI_GetValue ("SF9_C18")
var vartot1=var11+var12+var13+var14+var15+var16+var17+var18;
if (vartot1!=100) {strErrorMessage = "Your total must equal 100%";}

<script type="text/javascript">
var var21=SSI_GetValue ("SF9_C21")
var var22=SSI_GetValue ("SF9_C22")
var var23=SSI_GetValue ("SF9_C23")
var var24=SSI_GetValue ("SF9_C24")
var var25=SSI_GetValue ("SF9_C25")
var var26=SSI_GetValue ("SF9_C26")
var var27=SSI_GetValue ("SF9_C27")
var var28=SSI_GetValue ("SF9_C28")
var vartot2=var21+var22+var23+var24+var25+var26+var27+var28;
if (vartot2!=100) {strErrorMessage = "Your total must equal 100%";}


<script type="text/javascript">
function calcSum1()
var Sum = 0;
Sum = Number(document.getElementById("SF9_C11").value)
+ Number(document.getElementById("SF9_C12").value)
+ Number(document.getElementById("SF9_C13").value)
+ Number(document.getElementById("SF9_C14").value)
+ Number(document.getElementById("SF9_C15").value)
+ Number(document.getElementById("SF9_C16").value)
+ Number(document.getElementById("SF9_C17").value)
+ Number(document.getElementById("SF9_C18").value);
document.getElementById("SF9_C1tot").value = Sum;

<script type="text/javascript">
function calcSum2()
var Sum = 0;
Sum = Number(document.getElementById("SF9_C21").value)
+ Number(document.getElementById("SF9_C22").value)
+ Number(document.getElementById("SF9_C23").value)
+ Number(document.getElementById("SF9_C24").value)
+ Number(document.getElementById("SF9_C25").value)
+ Number(document.getElementById("SF9_C26").value)
+ Number(document.getElementById("SF9_C27").value)
+ Number(document.getElementById("SF9_C28").value);
document.getElementById("SF9_C2tot").value = Sum;
The one thing I saw right away is that you don't need the script tags on the custom javascript verification tab.  Remove <script type="text/javascript"> and </script> on that tab and it will work.  That's the issue.