Web Form Builder help with results -...

User 2292452 Photo


Registered User
10 posts

Hello,

I would like to display the results of the form on my webpage. I have 6 yes/no radio buttons and I would like to be able to count the number of "yes" answers and if there are more than 2 yes answers to have it say something like, "looks like you could use my help". I am not positive if Web Form Builder would be able to help me with displaying the results and/or the quote. If not, do you know how I could do these things? I am trying to teach myself and haven't figured this out. Thank you for any help you may be able to give to me. Thank You!
User 2147626 Photo


Ambassador
2,958 posts

Yes, you can do it, but it'll take some work. There's probably several ways to do this. I do not code so I'm not able to give you the specifics on modifying the code, but you could use the condionals and display your radio buttons one at a time based on progressive answers.

First question, if yes then display this next question ... if no then display this other question.

Keep going through your questions till you get to the pint where you want to display your quote. Like I said, doable, but it'll take some work to set up. Once set, should work like a charm.

That's just one way though. I'm sure Eric or one of the other coders can show you how to add the yes/no answers and display the proper quote, but you'd have to modify the code the form builder gives you.
Graphics for the web, email, blogs and more!
-------------------------------------
https://sadduck.com
User 2292452 Photo


Registered User
10 posts

Thank you, Gunsmoke. I figured out another way to get the form results to show on the same page. I am now wondering if someone could help me figure this out. This code shows the number of "yes" answers and the number of "no" answers. I now want to say if more than 2 or more answers equal "yes" then print "looks like you need my help"

<SCRIPT LANGUAGE="JavaScript"><!--
function showAnswers() {
var yes = 0;
var no = 0;
for (var i=0;i<7;i++) {
if (eval("document.radioForm.q" + i + "[0].checked") == true)
yes++;
if (eval("document.radioForm.q" + i + "[1].checked") == true)
no++;
}
document.radioForm.yes.value = yes;
document.radioForm.no.value = no;
}
//--></SCRIPT>
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

Hi DJ,
Add a html element to your page and paste the code below into it.
<script src="common/libs_js/jquery-1.4.4.min.js"></script> <script>$(document).ready(function() {
$("input:checkbox").change(function() {
if ($(this).val() == "yes"){
var total= $("input[value=yes]:checked").size();
if(total>2){
alert("It looks like you need my help.");
}
}
});
});</script>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2292452 Photo


Registered User
10 posts

Thank you for your assistance, Eric but I am unclear on what you are saying when you say, "Add a html element to your page". I am sorry I feel I should know what this means but I do not at the moment. I am trying to teach myself and every once and awhile I get stumped and this is one of those occasions. Here, let me show you my code so you can see what I am trying to do:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)">
<meta name="dcterms.created" content="Tue, 28 Oct 2014 02:06:58 GMT">
<meta name="description" content="">
<meta name="keywords" content="">
<title></title>
</head>
<body>

<FORM NAME="radioForm">
<div align="center"><b><font size="5">When your home becomes/stays messy or cluttered, do you feel like doing this? <br><br>
<img src="pulling out hair250.jpg" width="250" height="182" alt="" title="" /><br><br><font color="#c60c31">Yes <INPUT TYPE="RADIO" NAME="q0">
No </font><INPUT TYPE="RADIO" NAME="q0"><BR><BR><BR>

Do you need help moving?<br><font size="3"><font color="#C60C31">I can help you with downsizing, combining households, labeling, packaging<br> and getting your home ready to be shown
with a real estate company.</font></font><BR><BR><img src="downsizing.jpg" width="249" height="102" alt="" title="" />
<br><br><font color="#c60c31">Yes <INPUT TYPE="RADIO" NAME="q1"> No </font><INPUT TYPE="RADIO" NAME="q1"><BR><BR><BR>

During the holidays, do you have time to do everything that needs to be done? <br><br><img src="todolistxcf.jpg" width="250"
height="400" alt="" title="" /><BR><BR> <font color="#c60c31">Yes <INPUT TYPE="RADIO" NAME="q2">No </font><INPUT TYPE="RADIO" NAME="q2"><BR><BR><BR>

Do you need your closet or garage cleaned and organized?<BR><BR><img src="MESSYcloset150.JPG" width="150" height="203"
alt="" title="" /><img src="CLEANcloset150.JPG" width="150" height="200" alt="" title="" /> <BR><BR><font color="#c60c31">Yes <INPUT TYPE="RADIO" NAME="q3">
No </font><INPUT TYPE="RADIO" NAME="q3"><BR><BR><BR>

Do you have documents in your picture folder and pictures in your documents? <font color="#c60c31">Yes <INPUT TYPE="RADIO" NAME="q4">No</font> <INPUT TYPE="RADIO" NAME="q4">
<br>or Do you need files put in their own folders? <font color="#c60c31">Yes <INPUT TYPE="RADIO" NAME="q5">No</font> <INPUT TYPE="RADIO" NAME="q5"><BR><BR><BR>

Can you get organized at work while making sure to meet your deadlines?<br><br><img src="deadline250.jpg" width="250" height="348" alt="" title="" /><br><br>
<font color="#c60c31"> Yes <INPUT TYPE="RADIO" NAME="q6">No </font><INPUT TYPE="RADIO" NAME="q6"><BR><BR><BR></b><BR><BR><BR>

<P>
<INPUT TYPE="BUTTON" onClick="showAnswers()" VALUE="Check Answers">
<font color="#c60c31">yes: <INPUT TYPE="TEXTBOX" NAME="yes" VALUE="" SIZE="3">
no: <INPUT TYPE="TEXTBOX" NAME="no" VALUE="" SIZE="3">
</FORM></div>

<SCRIPT LANGUAGE="JavaScript"><!--
function showAnswers() {
var yes = 0;
var no = 0;
for (var i=0;i<7;i++) {
if (eval("document.radioForm.q" + i + "[0].checked") == true)
yes++;
if (eval("document.radioForm.q" + i + "[1].checked") == true)
no++;
}
document.radioForm.yes.value = yes;
document.radioForm.no.value = no;
}
//--></SCRIPT>
</body>
</html>
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

In the form builder you have an html element that you can add to your form. Select that and add it to your form then paste the code I provided into it. Now test your form.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2292452 Photo


Registered User
10 posts

I am sorry. This is way above my head but it is definitely something I want to know how to do. Thank you for your time and assistance.

Is this the HTML element you are talking about:

<style>#docContainer .fb_cond_applied{ display:none; }</style><noscript><style>#docContainer .fb_cond_applied{ display:inline-block; }</style></noscript><form class="fb-toplabel fb-100-item-column selected-object" id="docContainer"
action="" enctype="multipart/form-data" method="POST" novalidate="novalidate"
data-form="preview">
<div class="fb-form-header" id="fb-form-header1" style="min-height: 0px;">
<a class="fb-link-logo" id="fb-link-logo1" target="_blank"><img title="Alternative text" class="fb-logo" id="fb-logo1" style="display: none;" alt="Alternative text" src="common/images/image_default.png"/></a>
</div>
<div class="section" id="section1">
<div class="column ui-sortable" id="column1">
<div class="fb-item fb-100-item-column" id="item1">
<div class="fb-html">
<div id="item1_div_0">
<a href="http://www.coffeecup.com/" target="_blank">Your custom HTML</a>
</div>
</div>
</div>
</div>
</div>
<div class="fb-captcha fb-item-alignment-center" id="fb-captcha_control"
style="display: none; cursor: default;">
<img src="editordata/images/recaptchawhite.png" />
</div>
<div class="fb-item-alignment-left fb-footer" id="fb-submit-button-div"
style="min-height: 0px;">
<input class="fb-button-special" id="fb-submit-button" type="submit" data-regular="url('file:///C:/Users/DawnJBJ/AppData/Local/Temp/FormBuilder/theme/default/images/btn_submit.png')"
value="Submit" />
</div>
</form>
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

No,
Open the form builder.
Go to the "Elements" tab and scroll down to the "HTML" and click it.
Now click on the actual HTML element on the form.
Now click on the "Properties" tab.
Now remove the html link text that's already in the content area and paste the code I provided above.
Test you form.


I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2292452 Photo


Registered User
10 posts

Yeah, I think I got it with much of your time and assistance. Thank you. Can I do the same thing for the "no" response? Thank you.
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

Yes.
<script src="common/libs_js/jquery-1.4.4.min.js"></script> <script>$(document).ready(function() {
$("input:checkbox").change(function() {
if ($(this).val() == "yes"){
var total= $("input[value=yes]:checked").size();
if(total>2){
alert("Yes it does looks like you need my help.");
}
}if ($(this).val() == "no"){
var total= $("input[value=no]:checked").size();
if(total>2){
alert("It doesn't look like you need my help.");
}
}

});
});</script>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.