Adding a percentage to the Form...

User 187934 Photo


Senior Advisor
20,194 posts

I need to know what value your suppose to get in the field.
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 460613 Photo


Registered User
33 posts

I'm trying to have the total amount be the amount paid x 3%.

I thought I had it correct but when it went to the checkout, it saw the calculation as a quantity and multiplied it.

User 187934 Photo


Senior Advisor
20,194 posts

Did you set one as a multiplier in the elements properties box for payments?
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 460613 Photo


Registered User
33 posts

uh oh - I don't think so. Where should I have done that?

I have three elements.
One is the price input
two was the total including handling fee - see below. Is that where I should be putting it?

then the HTML element.

Attachments:
User 187934 Photo


Senior Advisor
20,194 posts

If I understand you correctly. Try this.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript">$(document).ready(function(){
$('#item2_number_1').attr('readonly', true);
$('#item1_number_1').keyup(function(){
var valone = $('#item1_number_1').val();
var valtwo = 1.03;
var total = (valone * valtwo);
$('#item2_number_1').val(total.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
User 695331 Photo


Registered User
14 posts

I have a similar simple problem and have done my best to create a JQuery based on Eric's original example. However I can't get it working. I simply want to subtract an actual amount from a budget amount and display the difference in the next field down. I'm just not familiar enough with JQuery language. Could someone help? Looks like I can't attach the form, so here is my JQuery

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">$(document).ready(function(){
$('#number10').keyup(function(){
var valone = $('#number10').val();
var valtwo = $('#number11').val();
var total = (valone - valtwo);
$('#number37').val(total);
});
$('#number11').keyup(function(){
var valone = $('#number10').val();
var valtwo = $('#number11').val();
var total = (valone - valtwo);
$('#number37').val(total);
});
});</script>

Thanks to everyone who volunteers here



Attachments:
User 187934 Photo


Senior Advisor
20,194 posts

Hi David, Do these id's actually exist on the form? These should match the id's of the inputs on your form.
#number10
#number11
#number37
They should be similar to this unless you altered the form.
#item1_number_1
Also you left off the s in this script.:)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></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 695331 Photo


Registered User
14 posts

Hi Eric

Thanks for offering to help!

Those are the Names of the form elements involved. Is that the same as IDs?

I fixed the https and tested it just using the Preview control, but it still didn't work. Wold that have prevented access to the resource?

It is 1:30 am so I have to go to bed now and do any other testing in the morning.

Could there be something blocking the JQuery for some security reason? I just have a normal hostgator server with no special security on it

Thanks again

Cheers
User 187934 Photo


Senior Advisor
20,194 posts

Can you provide a link?
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 695331 Photo


Registered User
14 posts

After studying up a bit on JQuery I now understand what you meant by '#item1_number_1' .

On the way to this understanding I started using $('input[name=number10]') (or $('select...) . I liked these because they referred to the same names that I could see clearly in the Web Form Builder window.

I'm really enjoying my little JQuery adventure. Never heard of it before. Great stuff!

Thanks for your help, Eric!

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.