Hello
I tried to make a form witch is calculate on the fly. But it does not work. Here is the code of the JS onload:
i got a Checkbox group (erscheinungen)
textfield (spalten1)
textfield (hoehemm1)
The value_mm is the VALUE of 'hoehemm'
The value_spalten is the VALUE of 'spalten'
The 'erscheinungen' is the VALUE of counted checkboxes
The 'rabatt' is 10 if 'erscheinungen' > 3
value_mm * value_spalten is the result 'totalmm'
totalpreis is the Product from 'totalmm' * 1.15
The 'wrabatt' is 'totalprise' / 100 * 'rabatt'
End Prise is: totalpreis - wrabatt
and The results should be displayd like this under the hoehemm field:
So how i get this, is this Possible or is this only a fiction?
Sorry about my English but this is not my favorit language.
Thanks for your help.
bambid
I tried to make a form witch is calculate on the fly. But it does not work. Here is the code of the JS onload:
window.addEvent('load', function() {
current_auswahl = 8;
spalten = $('spalten1');
hoehemm = $('hoehemm1');
.addEvent('onclick', function() {
erscheinungen = $$('.Chronoform checkbox:checked').length;
if(erscheinungen > 3){
var rabatt = 10;
};
}
// get the current value of the input field
spalten.addEvent('keyup', function() {
value_spalten = spalten.value;
value_totalmm = value_spalten * value_mm;
value_totalpreis = value_totalmm * 1.15 * current_auswahl;
value_wrabatt = value_totalpreis / 100*rabatt;
value_totalinkl = value_totalpreis - value_wrabatt;
$('spalten').innerHTML = value_spalten;
$('hoehemm').innerHTML = value_mm;
$('totalmm').innerHTML = value_totalmm;
$('totalpreis').innerHTML = value_totalpreis;
$('wrabatt').innerHTML = wrabatt;
$('totalinkl').innerHTML = value_totalinkl;
$('preisersch').innerHTML = value_totalinkl / rabatt;
});
hoehemm.addEvent('keyup', function() {
value_mm2 = hoehemm.value;
value_mm = value_mm2.length;
value_totalmm = value_spalten * value_mm;
value_totalpreis = value_totalmm * 1.15 * current_auswahl;
value_wrabatt = value_totalpreis / 100*rabatt;
value_totalinkl = value_totalpreis - value_wrabatt;
$('spalten').innerHTML = value_spalten;
$('hoehemm').innerHTML = value_mm;
$('totalmm').innerHTML = value_totalmm;
$('totalpreis').innerHTML = value_totalpreis;
$('wrabatt').innerHTML = wrabatt;
$('totalink').innerHTML = value_totalink;
$('preisersch').innerHTML = value_totalinkl / rabatt;
}); });
i got a Checkbox group (erscheinungen)
textfield (spalten1)
textfield (hoehemm1)
The value_mm is the VALUE of 'hoehemm'
The value_spalten is the VALUE of 'spalten'
The 'erscheinungen' is the VALUE of counted checkboxes
The 'rabatt' is 10 if 'erscheinungen' > 3
value_mm * value_spalten is the result 'totalmm'
totalpreis is the Product from 'totalmm' * 1.15
The 'wrabatt' is 'totalprise' / 100 * 'rabatt'
End Prise is: totalpreis - wrabatt
and The results should be displayd like this under the hoehemm field:
<h4>Höhe <span id='hoehemm'>50</span></h4>
<h4>Spalten <span id='spalten'>0</span></h4>
<h4>Total mm <span id='totalmm'>0</span></h4>
<h4>Preis <span id='totalpreis'>0</span></h4>
<h4>Wiederholungsrabatt <span id='wrabatt'>0</span></h4>
<h4>Total Preis nach Abzug des Rabattes <span id='totalinkl'>0</span></h4>
<h4>Preis pro Erscheinung <span id='preisersch'>0</span></h4>
So how i get this, is this Possible or is this only a fiction?
Sorry about my English but this is not my favorit language.
Thanks for your help.
bambid
Hi bambid,
In general we don't debug user custom scripts for them but here I noticed a couple of things in this block of code:
Bob
In general we don't debug user custom scripts for them but here I noticed a couple of things in this block of code:
.addEvent('onclick', function() { // you need an element here xxx.addEvent(
erscheinungen = $$('.Chronoform checkbox:checked').length;
if (erscheinungen > 3) {
var rabatt = 10;
};
}); // the closing brackets are missing.
Bob
Hello Bob
Sorry but my question was is it possible a live calculating to do in a form or not. With those elements? the Rest i would try to figured out.
Thanks bambid
Sorry but my question was is it possible a live calculating to do in a form or not. With those elements? the Rest i would try to figured out.
Thanks bambid
Hello Bob
I Tried hard to figured it out. But There is no chance for me!
Here is the Link to the Page:
http://mobus.ch/index.php?option=com_chronoforms&tmpl=component&chronoform=Inseratbestellung_Gute-Fahrt
The Problem is, if I checked more than 3 there is no change in the List below.
What can i to or give me a hint that i find the right way.
Thanks
bambid
I Tried hard to figured it out. But There is no chance for me!
Here is the Link to the Page:
http://mobus.ch/index.php?option=com_chronoforms&tmpl=component&chronoform=Inseratbestellung_Gute-Fahrt
The Problem is, if I checked more than 3 there is no change in the List below.
What can i to or give me a hint that i find the right way.
Thanks
bambid
Hello Bob
Is it possible to get the Variable
Inside the Mail witch i send to my costumer?
If yes, please give me a hint.
Thanks
bambid
Is it possible to get the Variable
<h4>Total Preis nach Abzug des Rabattes <span id='totalinkl'>0</span></h4>
Inside the Mail witch i send to my costumer?
If yes, please give me a hint.
Thanks
bambid
Hi Bambid,
Add a hidden input to your form with say id='xx_price'.
Have your JavaScript set the value of the input $('xx_price') = . . . ;
Use {xx_price} in the Email template: <h4>Total Preis nach Abzug des Rabattes
Bob
Add a hidden input to your form with say id='xx_price'.
Have your JavaScript set the value of the input $('xx_price') = . . . ;
Use {xx_price} in the Email template: <h4>Total Preis nach Abzug des Rabattes
<span id='totalinkl'>{xx_price}</span></h4>
Bob
Hi Bob, I tried the "preis" to pass, unfortunately it did not work. I tried it with diffrent variants. ".InnerHTML" then the "$('preis').input)=" but unfortunately without success. I've ried to examine the results in the debugger, but this is still empty.
What else can I do about it now?
I need the price that I can send it directly to paypal.
I ask you just to help me. if you still need more information, then you can feel free to contact me.
The Form can you find under:
http://www.fricktal.info/index.php?option=com_chronoforms&tmpl=component&chronoform=Kleinanzeigen
Best regards
bambid
What else can I do about it now?
I need the price that I can send it directly to paypal.
I ask you just to help me. if you still need more information, then you can feel free to contact me.
The Form can you find under:
http://www.fricktal.info/index.php?option=com_chronoforms&tmpl=component&chronoform=Kleinanzeigen
Best regards
bambid
Hi bambid,
I see this error
You also seem to have two versions of MooTools loading though I'm not sure that is causing any problems.
Bob
I see this error
ReferenceError: kosten is not defined
rabatt_bet = kosten/100*rabatt;
You also seem to have two versions of MooTools loading though I'm not sure that is causing any problems.
Bob
Hello Bob
I do not know where you got this error happens. To me when I get to the debugger this display:
with "[kalenderwo] =>" and "[price] =>" of each value should be passed.
kalenderwo = KalenderWoche()
preis = preis_tot.toFixed(2)
But it would not work.
do you ned the Javascript and HTML Code to find it out?
Best Regards
bambid
I do not know where you got this error happens. To me when I get to the debugger this display:
Data Array:
Array
(
[option] => com_chronoforms
[tmpl] => component
[chronoform] => Kleinanzeigen
[event] => submit
[Itemid] =>
[name] =>
[input_text_7] => 34
[input_radio_2] => ErSie
[text] => 34
[kalenderwo] =>
[preis] =>
[input_submit_6] => Submit
[70ccd68aebd22acbcdf76a4e098fb2fb] => 1
)
Validation Errors:
Array
(
)
with "[kalenderwo] =>" and "[price] =>" of each value should be passed.
kalenderwo = KalenderWoche()
preis = preis_tot.toFixed(2)
But it would not work.
do you ned the Javascript and HTML Code to find it out?
Best Regards
bambid
Hello Bob
I think i got it. i wrote with .innerHTML but i have to take .value.
Now i got another Problem. I made a Paypal link like This:
http://www.chronoengine.com/faqs/2583-how-to-use-the-paypal-redirect-action.html
It works, but the Amount field will not overgive the right value. If i Debbug with the chronoforms the "preis" will still be 10
If i try it with Paypal
"preis" is variable on every submit, like:
1. 20
2. 50
3. 20
4. 30
...
I did not change anything while i'm submit. Still the same values.
A guess?
Thanks Best Regards
bambid
I think i got it. i wrote with .innerHTML but i have to take .value.
Now i got another Problem. I made a Paypal link like This:
http://www.chronoengine.com/faqs/2583-how-to-use-the-paypal-redirect-action.html
It works, but the Amount field will not overgive the right value. If i Debbug with the chronoforms the "preis" will still be 10
If i try it with Paypal
"preis" is variable on every submit, like:
1. 20
2. 50
3. 20
4. 30
...
I did not change anything while i'm submit. Still the same values.
A guess?
Thanks Best Regards
bambid
This topic is locked and no more replies can be posted.