FacileForms: sumbit textfield.value after math operation - Joomla! Forum - community, help and support
how can sumbit value of form? got text field host result
example.
text field "a"
select list "b"
text field "c".value = a.value * b.value
the result , math works, when click sumbit button , doesn't send nothing!
if drop c, works fine.
any solution?
code of math , script adapted samples of ff, sample pizza.
here's scripst:
to list b:
function ff_b_action(element, action)
{
switch (action) {
case 'change':
ff_wordcost_calculate();
break;
default:;
}
}
to text field a:
function ff_a_action(element, action)
{
switch (action) {
case 'change':
ff_wordcost_calculate();
break;
default:;
}
}
to text field c:
function ff_c_validation(element, message)
{
ff_wordcost_calculate();
if (ff_getelementbyname('word').value=='') {
ff_validationfocus('word');
return message;
} // if
if (ff_getelementbyname('language').value=='') {
ff_validationfocus('language');
return message;
}
return '';
}
function ff_wordcost_calculate()
{
var amount = 0;
var numeroparole;
var costolingua;
var cost = 0;
numeroparole = ff_getelementbyname('word').value;
costolingua = ff_getelementbyname('language').value;
if (numeroparole!= '') {
numeroparole = parseint(numeroparole);
cost = parseint(numeroparole)*costolingua;
}
ff_getelementbyname('wordcost_total').value = math.round(cost)/100;
return ff_getelementbyname('wordcost_total').value;
} // ff_wordcost_calculate
example.
text field "a"
select list "b"
text field "c".value = a.value * b.value
the result , math works, when click sumbit button , doesn't send nothing!
if drop c, works fine.
any solution?
code of math , script adapted samples of ff, sample pizza.
here's scripst:
to list b:
function ff_b_action(element, action)
{
switch (action) {
case 'change':
ff_wordcost_calculate();
break;
default:;
}
}
to text field a:
function ff_a_action(element, action)
{
switch (action) {
case 'change':
ff_wordcost_calculate();
break;
default:;
}
}
to text field c:
function ff_c_validation(element, message)
{
ff_wordcost_calculate();
if (ff_getelementbyname('word').value=='') {
ff_validationfocus('word');
return message;
} // if
if (ff_getelementbyname('language').value=='') {
ff_validationfocus('language');
return message;
}
return '';
}
function ff_wordcost_calculate()
{
var amount = 0;
var numeroparole;
var costolingua;
var cost = 0;
numeroparole = ff_getelementbyname('word').value;
costolingua = ff_getelementbyname('language').value;
if (numeroparole!= '') {
numeroparole = parseint(numeroparole);
cost = parseint(numeroparole)*costolingua;
}
ff_getelementbyname('wordcost_total').value = math.round(cost)/100;
return ff_getelementbyname('wordcost_total').value;
} // ff_wordcost_calculate
Comments
Post a Comment