Can this program do calculations? -...

User 187934 Photo


Senior Advisor
20,188 posts
Online Now

Cool.
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 114736 Photo


Registered User
8 posts

Alright so I plugged in the code and put in my items. http://wwwsliders.coffeecup.com/forms/R … er%20Form/

Couple of questions.

1. How do I add in pictures in between the Item Name and the part number/price?

2. How can I add the description of the item below the Item Name so that it looks clean like I have it in the regular example using the webform builder elements?

3. Is there anyway to make the field where I put the quantity and the total cost field, both fields smaller so that i'm able to fit 2 items side by side like I have on my original form?

4. Now that I have my items in how can I make it so that if the grand total is less than $1000.00 then a payment information field pops up. If the total is over $1000.00 then nothing happens and the person can just click submit?

Thanks!!!
~seacow
User 187934 Photo


Senior Advisor
20,188 posts
Online Now

1. You could use Jquery or edit the form after export.
2. Leave the label blank and add another element.
3. Set their width smaller.
4. Set an if statement in the code that hide or shows the elements.
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 114736 Photo


Registered User
8 posts

thanks!. so i'm just quickly testing out the submission so i can see what it looks like when people get a confirmation email with their results and totals but it won't let me. it keeps giving me an error.
http://wwwsliders.coffeecup.com/forms/R … er%20Form/
screen shot attached
Attachments:
~seacow
User 187934 Photo


Senior Advisor
20,188 posts
Online Now

The form won't submit for me.
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 376096 Photo


Registered User
32 posts

Hi Eric, I have a couple questions I hope you can help me with.

First off, I have the start of my form up on s-drive at http://jmacintosh.coffeecup.com/forms/PRForm/

Here's what I want to do...

I want to calculate a formula (Player Rating) using a total of 6 numbers, input by the user. The top row is one set of averages from 3 games of 501 (darts) which they put in the form. The second line is a second set of averages from 3 games of Cricket.

I can do this in Excel format if it helps you understand what I want to do.

Player Rating =AVERAGE(501 gm1, 501 gm2, 501 gm3)+(AVERAGE(Cr gm1, Cr gm2, Cr gm3)*10)

I have no experience with jquery, so I unfortunately have no idea where to begin to code it. Thank you for any help you or anyone else here can offer!

PS edit...All averages are input to 2 decimal places (25.55)
User 187934 Photo


Senior Advisor
20,188 posts
Online Now

Hi Jeffery,
See if this works for ya. I assumed you were going to use that reg expression for the ranking so change it's name to ranking if so. Otherwise let me know if you need more instructions.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
var jQ = $.noConflict(true);
jQ(document).ready(function(){
//The inputs you want read only
jQ('input[name^="ranking"]').attr('readonly', true);

//inputs that will need to be calculated
jQ('input[name^="g"]').addClass('cal');
jQ('input[name^="crg"]').addClass('cal');

//Trigger on key
jQ('.cal').bind('keyup blur change',function(){
var jQnonempty = jQ('.cal').filter(function() {
return this.value != ''
});
if (jQnonempty.length !== 0) {
// Set variables for each input by name
var g1 = jQ('input[name="g1"]').val();
var g2 = jQ('input[name="g2"]').val();
var g3 = jQ('input[name="g3"]').val();
var crg1 = jQ('input[name="crg1"]').val();
var crg2 = jQ('input[name="crg2"]').val();
var crg3 = jQ('input[name="crg3"]').val();
//501 game avg.
var gavg = (+g1 + +g2 + +g3)/3;
// Cricket Game avg.
var crgavg = (+crg1 + +crg2 + +crg3)/3;
//Ranking
var ranking = gavg + crgavg;

jQ('input[name="ranking"]').val(ranking.toFixed(2));
}

});

});</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.