how to add or subtract two fields

Status
Not open for further replies.

madhusudhan

New Member
Dear sir,
How to add or subtract integers in two fields of the table and display in third field and store this third field in the database.
Thanking you
Madhusudhan
 
Just to make it clear, you need the fabrikcalc element, not the (deprecated) fabrikcalculation one.

-- hugh
 
Dear sir,
Thank you very much for your reply,
but i am useing the Fabrik 1.0.6 version for joomla 1.1 version,
and where can i download the fabrikcalc element and how to install it without useing the svn.
please reply soon,
Thanking you
Madhusudhan
 
Ooops, I'm sorry, I didn't notice we were in the 1.0 forum.

You'll have to:

Create your 'total' element as a simple field (text) element, set to read-only if you want.

Add javascript actions on the two elements you want to sum (lets say they are called 'element_one' and 'element_two') something like this:

$('tablename___total') = 0 + $('tablename___element_one').value + $('tablename___element_two');

If you need to check on what the names are, look at the source of a Fabrik form page, or use FireBug in FireFox to inspect the form elements.

-- hugh
 
that should be:

$('tablename___total').value = 0 + $('tablename___element_one').value + $('tablename___element_two').value;
 
Ooops, good catch.

New Rule - any posts Hugh makes after 1am should be assumed to have errors in them. :)

-- hugh
 
Dear sir,
Thank you very much for your quick reply,
but when i click on the add button, it is displaying the all theree fields twice and displaying some wrong 5 digit numbers in the third field.
please reply soon
Thanking you
Madhusudhan
 
Ah, you didn't say it was in a repeated group.

You'll have to point me at the page, as I don't have a test case to work with for 1.0.x any more.

-- hugh
 
I've removed the username and password from your post - this is a public forum, and not everyone on the Internet is nice.

Please send me a PM with those details.

-- hugh
 
Is there a particular reason you are starting out with Joomla 1.0.x? It looks like a new site, and I don't see anything on your component list which doesn't have a J! 1.5 version.

The Fabrik 1.0.x product is essentially end-of-lifed ... we're no longer doing any active development on it, and restricting our efforts to just fixing any serious bugs in the core functionality that may crop up.

All our efforts moving forward are on Fabrik 2.0, which runs on J! 1.5.x.

BTW, one thing I noticed - you seem to have put the custom JS on your total element ... but my advice earlier was to put the same code on both the elements you want to sum, not on the total field.

Try that, see if the JS actually works on the first group. Although I'm pretty sure it won't work on subsequent repeated groups.

-- hugh
 
I should advise you that it may still not be trivial getting JavaScript to work on repeated groups, but at least you will be on the latest and greatest version of both Joomla itself, and Fabrik.

And J! 1.5 is definitely the way to go, as the J! 1.0.x series is no longer being developed.

Once you get J! 1.5 installed, try installing the latest nightly build of Fabrik 2.0.

Again, I should warn you that some folk have issues initially installing Fabrik, because it's a large ZIP. But if you have issues, just post in the 2.0 Subscriber forum, and we'll show you how to get it installed and up to date.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top