Set value of other fields, but editable


i want automatically set values of 3 fields 1 of 2 fields filled. want user able change set value if needs to.

the code below works setting values in 3 fields, if 1 attempts change 1 these 3 values, error appears. understand values of fields should either set values or nothing, how can make editable?

 

if((event.value != "")  || (this.getfield("f").value != ""))

 

{

this.getfield("a").value = "50";

this.getfield("b").value = "40";

this.getfield("c").value = "40";

} else {

this.getfield("a").value = "";

this.getfield("b").value = "";

this.getfield("c").value = "";

}

where code placed (which field, event) , exact error message?



More discussions in JavaScript


adobe

Comments