Returning Previous field value if successor field value isn’t filled
-
Hi Codepeople
First of all thank you for this wonderful plugin.
I’m having fieldname2, fieldname3… and so on till fieldname11. I want to retrieve data of the last fieldname. For example, if someone fills field all the way till fieldname11, then retrieved value is of fieldname11. If someone fills field all the way till fieldname10, and fieldname11 is left null or without any value, then retrieved value is of fieldname10. If someone fills field all the way till fieldname9, and fieldname10 and fieldname11 is left null or without any value, then retrieved value is of fieldname9 and so on….
(function(){
if(fieldname11 === null) return fieldname10;
if(fieldname10 === null) return fieldname9;
if(fieldname9 === null) return fieldname8;
if(fieldname8 === null) return fieldname7;
if(fieldname7 === null) return fieldname6;
if(fieldname6 === null) return fieldname5;
if(fieldname5 === null) return fieldname4;
if(fieldname4 === null) return fieldname3;
if(fieldname3 === null) return fieldname2;
if(fieldname2 === null) return fieldname1;
return ”;
})();
Also how can i hide a fieldname until previous fieldname if filled. Thank you
- The topic ‘Returning Previous field value if successor field value isn’t filled’ is closed to new replies.