Hi
I have a simple (i hope) question i'm stuck on...
At one stage in our form we ask for home, cell and work numbers. These are optional.
at a later point we want to re-use the phone contact information provided earlier
at the second place (call it field X for our example) where this data is use I was just going to go something like
this.rawValue = A.rawValue + B. rawValue + C. rawValue;
where A, B, C are the earlier home, work and cell phone fields and this = X.
But this will produce inserted NULL fields if the user leave the initial field blank (e.g. if they only have a cell and so leave home empty).
So I would like to test to see if the field is null before it is used
can someone suggest some code that allows for the following logic
x.rawValue = A.rawValue + B.rawValue + C.rawValue SO LONG AS A, B AND C ALL HAVE PHONE NUMBERS ENTERED
else if ONLY A AND B have data then x.rawValue = A.rawValue + B.rawValue
else if ONLY A and C
or only A
etc
then the corresponding filled only fields from x's rawvalue ---
I've experimented with various syntax but cant get it quite right --- can anyone help or does someone have a sample of something similar i can mold to my needs?
thanks in advance
Solved! Go to Solution.
Views
Replies
Total Likes
var strAValue, strBValue, strCValue
//Get A Value
if(A.rawValue ==null || A.rawValue =="")
strAValue = "";
else
strAValue = A.rawValue;
//Get B Value
if(B.rawValue ==null || B.rawValue =="")
strBValue = "";
else
strBValue = B.rawValue;
//Get C Value
if(C.rawValue ==null || C.rawValue =="")
strCValue = "";
else
strCValue = C.rawValue;
X.rawValue = strAValue + strBValue + strCValue;
Hope this helps..
Thanks
Srini
Views
Replies
Total Likes
var strAValue, strBValue, strCValue
//Get A Value
if(A.rawValue ==null || A.rawValue =="")
strAValue = "";
else
strAValue = A.rawValue;
//Get B Value
if(B.rawValue ==null || B.rawValue =="")
strBValue = "";
else
strBValue = B.rawValue;
//Get C Value
if(C.rawValue ==null || C.rawValue =="")
strCValue = "";
else
strCValue = C.rawValue;
X.rawValue = strAValue + strBValue + strCValue;
Hope this helps..
Thanks
Srini
Views
Replies
Total Likes
hey, Thanks for that.
Works great
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies