Support

  1. alextunas
  2. General
  3. Sunday, February 09 2014, 09:29 PM
You can add a field whose value is calculated from other. For example:
I have 5 radio type fields (Yes or No): the Si are 1 and not 0.

Another field that will sum the values ​​of these 5 fields. Based on this value, if it is between 0 and 2 may have a low level, if it is between 3 and 4 have a medium level and if 5 will have a high level.
This is possible??
How?
admin Accepted Answer
Admin
Hi,
yes it's possible but not simple.

You need to write a plugin to do this, or you can with javascript (less secure).
  1. more than a month ago
  2. General
  3. # 1
alextunas Accepted Answer
To do this using javascript, you could show an example?
or
You can use a global variable and go validating each radio button?
Thanks
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
To do this using javascript, you could show an example?

- create a hidden field for store the sum of yours radio fields
- added this example code to your template
jQuery(document).ready(function($)
{
$('#member-registration,#member-profile').submit(function(){
var tot=0;
if($("[name ='jform[alias_of_radio_btn1]']:checked").length) tot+=parseInt($("[name ='jform[alias_of_radio_btn1]']:checked").val());
if($("[name ='jform[alias_of_radio_btn2]']:checked").length) tot+=parseInt($("[name ='jform[alias_of_radio_btn2]']:checked").val());
if($("[name ='jform[alias_of_radio_btn3]']:checked").length) tot+=parseInt($("[name ='jform[alias_of_radio_btn3]']:checked").val());
$("[name ='jform[alias_of_hidden_field]']").val(tot);
});
});
  1. more than a month ago
  2. General
  3. # 3
alextunas Accepted Answer
I have already done this, but as I can know if it works well, if you take the correct value?
I've put a alert (val) in the function, but not displayed. I have done something wrong?
  1. more than a month ago
  2. General
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.