Jump to content

How to combine normal fiels and field that are in an loop?


Muiter
 Share

Recommended Posts

function materiaalkost(selectVeld, nr){   // Stuur informatie terug	if (document.getElementsByName('inkoop[]')[nr].value == '')	{		document.getElementsByName('materiaalkost[]')[nr].value  = (document.getElementsByName('gewicht_stk[]')[nr].value * (document.getElementsByName('inkoop_b').value / 1000)).toFixed( 2 )	}	else	{		document.getElementsByName('materiaalkost[]')[nr].value  = (document.getElementsByName('gewicht_stk[]')[nr].value * (document.getElementsByName('inkoop[]')[nr].value / 1000)).toFixed( 2 )	}}

With the above code I'm trying to manipulate the 'materiaalkost[]' field. This field is in an loop. When the field 'inkoop[]' is not used the script should use the 'inkoop_b' field, this field is not in the for loop. For some reason even when 'inkoop[]' is not used this field is used but it should use the field 'inkoop_b'.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...