Hi Guys
I've got a problem which is similar to this post (http://www.gravityhelp.com/forums/topic/pricing-field-of-type-product-doesnt-validate) but I can't find an answer or a solution on the forums.
Here's what I'm experiencing:
- I have a hidden product field for a service fee (the client is using this to cover the PayPal transaction fee)
- The client needs it to be multiplied by the number of swimmers the user is paying for
- I've written a short piece of jQuery to update the product field when the number of swimmers is selected:
<script type="text/javascript">
jQuery("#input_5_5").change(function(){
var num_swimmers = jQuery("#input_5_5 option:selected").val();
var charge = num_swimmers * 3;
charge = charge.toFixed(2);
jQuery("#ginput_base_price_5_34").val("£ " + charge);
alert( jQuery("#ginput_base_price_5_34").val() );
});
</script>
The last alert shows the correct value, and matches the format of the product field when the page loads, but I get a validation error: "There was a problem with your submission. Errors have been highlighted below."
When I inspect the page, I can see that it's saying "Please enter a valid value." for the service charge.
Please could you let me know what I'm doing wrong? I really can't see the difference between my calculated value and the valid default value.
URL: http://sinkorswimcardiff.com/pay-now/
Thanks!
Andy