mardi 30 décembre 2014

Clear a value from a textfield and fill that value in an other textfield?

i have the following code:



var s1 = this.getField("One").value;
var s2 = this.getField("Two").value;
var s3 = this.getField("Three").value;
var s1n = this.getField("One");
var s2n = this.getField("Two");
var s3n = this.getField("Three");

if(s1.length > 0) & (s2.length == 0) & (s3.length == 0){
s1n = '' & s2n = s1 & s3n = ''
else if (s1.length > 0) & (s2.length > 0) & (s3.length == 0){
s1n = s1 & s2n = '' & s3n = s3
else if (s1.length > 0) & (s2.length > 0) & (s3.length > 0){
s1n = s1 & s2n = s2 & s3n = s3
}}}


I have three textfields in a row. If i fill out "One" only i want clear the value in "One" and fill that value in "Two". If i fill out "One" and "Two" i want to clear the value in "Two" and fill that value in "Three". If i fill out "One" and "Two" and "Three" i want to do nothing. But with the code above i get an syntax error. What i have to do, to get this working?


Aucun commentaire:

Enregistrer un commentaire