It worked out in the “underbust” field, but I don’t know why it’s not working again in the “cup size” field (which is the fieldname22) with this code:
(function(){
if(8 < fieldname23 && fieldname23 <= 10) return AAA;
if(10 < fieldname23 && fieldname23 <= 12) return AA;
if(12 < fieldname23 && fieldname23 <= 14) return A;
if(14 < fieldname23 && fieldname23 <= 16) return B;
if(16 < fieldname23 && fieldname23 <= 18) return C;
if(18 < fieldname23 && fieldname23 <= 20) return D;
})()
I replaced the code you sent with the values I needed in that field, but it’s not showing up…
“fieldname23” calculates the difference between bust and underbust, although it could also be replaced with the operation “fieldname3-fieldname2”, but I don’t know how to do it, so I put this extra field to calculate it.
I tried doing the whole operation with the code below, based on the one you sent too, but honestly I know absolutely nothing about javascript. I was trying to build a code out of the other topics answers, but nothing I do seems to work out:
(function(){
if(8 < (fieldname3-fieldname2) && (fieldname3-fieldname2) <= 10) return AAA;
if(10 < (fieldname3-fieldname2) && (fieldname3-fieldname2) <= 12) return AA;
if(12 < (fieldname3-fieldname2) && (fieldname3-fieldname2) <= 14) return A;
if(14 < (fieldname3-fieldname2) &&(fieldname3-fieldname2) <= 16) return B;
if(16 < (fieldname3-fieldname2) && (fieldname3-fieldname2) <= 18) return C;
if(18 < (fieldname3-fieldname2) && (fieldname3-fieldname2) <= 20) return D;
})()
After that, all I need is to show the result of “underbust size” and “cup size” together, one after another. For exemple, if you enter these values:
Underbust Measurement: 73
Bust Measurement: 80
You will have “Your Underbust Size” showing the number 42, and the “Your Cup Size” should be displaying the size AAA. In the field “Your Final Size” I’d like to display the whole size, which would be 42AAA.
Thank you for the fast reply!