• 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: Dynamic Update Fields based off ONCHANGE trigger

Dynamic Update Fields based off ONCHANGE trigger 10 years 9 months ago #28405

  • kefford
  • kefford's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
Hi,

I am looking for an easy way to adjust fields based on the value of another field. I tried the methon indicated in the form for creating a java script function like this,

<script type="text/javascript">
function populate(){
$_SESSION = document.getElementById('fMaker').value;
}
</script>

Then with adding the following to the Additional Attributes area of the field 'fMaker' that I wish to capture,

onchange="populate()";

As can be seen, my thought was to update a session variable with the changed value then use it to propogate the change to other fields. I am finding that nothing seems to happen. I want to re-populate another field based on the session variable having been changed. I clearly must be missing something.

Best I can tell it is like the fields remain un-changed. Do I need to force a refresh of a given field? If so, how? I do not want to submit the form until all values are captured. What I am trying to achieve is like a dynamic dropdown, but the values need to be read from an external database, not hard coded in the field itself.

Any thoughts or suggestions would be appreciated.
The administrator has disabled public write access.

Dynamic Update Fields based off ONCHANGE trigger 10 years 9 months ago #28409

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
The script you provided, tries to use a PHP variable through Javascript, which is not possible. For your described scenario you will have to use AJAX (keep in mind that advanced scripting knowledge is required)
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.
The following user(s) said Thank You: kefford
  • 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!