Hi,
i tried a few solutions but I have somewhere a mistake.
i what to add first just!!! two fields..
script was found here at the board..
Where is my error?
i tried a few solutions but I have somewhere a mistake.
i what to add first just!!! two fields..
script was found here at the board..
Where is my error?
HI WR,
The JavaScript you found is using the MooTools library which Joomla! has stopped using in Joomla! 3. Instead they are using jQuery. Here's a similar script using jQuery
I would set the thirdbox to readonly*, and add masks to the other two inputs.
Bob
* Put readonly=readonly in the Extra Params box
The JavaScript you found is using the MooTools library which Joomla! has stopped using in Joomla! 3. Instead they are using jQuery. Here's a similar script using jQuery
jQuery(document).ready(function(jQ){
jQ('#firstBox').on('keyup', calcTotal);
jQ('#secondBox').on('keyup', calcTotal);
function calcTotal() {
var first_box, second_box, total;
first_box = jQ('#firstBox').val();
if ( !jQ.isNumeric(first_box) ) {
first_box = 0;
}
second_box = jQ('#secondBox').val();
if ( !jQ.isNumeric(second_box) ) {
second_box = 0;
}
total = parseFloat(first_box) + parseFloat(second_box);
total = total.toFixed(0);
jQ('#thirdBox').val(total);
}
});
I would set the thirdbox to readonly*, and add masks to the other two inputs.
Bob
* Put readonly=readonly in the Extra Params box
Hi WR,
Please check for JavaScript errors on the page, You can see my test form working with this JavaScript here - so the basic code should be OK.
Bob
Please check for JavaScript errors on the page, You can see my test form working with this JavaScript here - so the basic code should be OK.
Bob
Hi, thanks for your Help.
I still can“t find my problem..
i made a backup ... please have a look
I still can“t find my problem..
i made a backup ... please have a look
Hi WR,
You have the form set to Custom Code in the Code tab - and the element IDs in the custom HTML there are different from those you have in the Designer tab. If you switch the form back to 'Wizard Designer' then it works correctly.
Bob
You have the form set to Custom Code in the Code tab - and the element IDs in the custom HTML there are different from those you have in the Designer tab. If you switch the form back to 'Wizard Designer' then it works correctly.
Bob
This topic is locked and no more replies can be posted.