Page 1 of 1

onSubmit doesnt fire

Posted: Wed Jun 06, 2012 9:15 pm
by inosent1

Code: Select all

<script type="text/javascript"><!--
function updatesum() {
document.smartform.sumx.value = (document.smartform.rma_wg4.value -0) + (document.smartform.rma_wg3.value -0);
document.smartform.sumz.value = (document.smartform.rma_sg4.value -0) + (document.smartform.rma_sg3.value -0);
document.smartform.disability.value = (document.smartform.b_other_income_d.value -0) + (document.smartform.b_other_income_d.value -0);
document.smartform.rental.value = (document.smartform.b_other_income.value -0) + (document.smartform.b_other_income.value -0);
document.smartform.alimony.value = (document.smartform.b_other_income_a.value -0) + (document.smartform.b_other_income_a.value -0);
document.smartform.misc_inc.value = (document.smartform.b_other_income_m.value -0) + (document.smartform.cb_other_income_m.value -0);
document.smartform.other_exp.value = (document.smartform.a_ins.value -0) + (document.smartform.a_transport.value -0) + (document.smartform.c_care.value -0) + (document.smartform.cabletv.value -0) + (document.smartform.dhl_ins.value -0) + (document.smartform.electricity.value -0) + (document.smartform.food.value -0) + (document.smartform.gas.value -0) + (document.smartform.h_ins.value -0) + (document.smartform.meds.value -0) + (document.smartform.internet.value -0) + (document.smartform.l_ins.value -0) + (document.smartform.misc_ex.value -0) + (document.smartform.misc_ex2.value -0) + (document.smartform.telephone.value -0) + (document.smartform.total_rental_exp.value -0) + (document.smartform.tuition.value -0) + (document.smartform.wsg.value -0);
}
//--></script>
then

Code: Select all

<form method="POST" autocomplete="on" NAME="smartform" target="_parent" action="edit_p.php" enctype="multipart/form-data" onSubmit="return updatesum()"><a NAME="tab1"></a>
but the function never runs. what is the way to force a 'change' to call the function upon submission?

Re: onSubmit doesnt fire

Posted: Wed Jun 06, 2012 11:20 pm
by pbs
try using submit button and call onclick event of button instead of onsubmit event of form, may this will help you

Re: onSubmit doesnt fire

Posted: Thu Jun 07, 2012 12:31 am
by social_experiment