• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Simple Javascript calc not working

Simple Javascript calc not working 12 years 1 month ago #22289

Hi,

I have a fairly simple Javascript calculation in my form. In order to get the results, I think I am doing things by the book:

1. Create a hidden field "result".

2. Create the script in "CSS and Javascript" area:

<script type="text/javascript">
function calculate() {
.
.
.
calculated = <some calculation>;
result = document.getElementById('result');
result.value = calculated;
}
</script>

3. Add in the "Additional Attributes" for the "Submit" button:

onclick="calculate();"

Having done these, I can see that the calculation is working ok via an 'alert(calculated)'. But, when I try to display the result in the Thank you message via a {result:value} all I get is a null. Am I doing something wrong or is RSForms Pro! broken?

Anurag
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!