Click to See Complete Forum and Search --> : onChange problem


saku
04-28-2003, 07:52 AM
i have a php site

then i have:

param1<input type=text name="params[]">
param2<input type=text name="params[]">
param3<input type=text name="params[]">
param4<input type=text name="params[]">
total<input type=text name="total">

then i added onChange events in each input but couldnt work it out
i want to change the value of total each time any input box is changed

khalidali63
04-28-2003, 07:56 AM
Post your code that you used in onchange event..
My recomendation though,
use onkyup event it works for sure with text fields..

saku
04-28-2003, 08:15 AM
in fact i couldnt even get "myForm.params[0].value" to work
i dont know if javascript is capable of handling arrays this way

khalidali63
04-28-2003, 08:18 AM
if you did this

param1<input type=text name="params">
param2<input type=text name="params">
param3<input type=text name="params">
param4<input type=text name="params">

and then tried something like this

document.formName.params[0].value,it will work

the way you have it params[]...
I guess some php guru can help you with that..

:D