Not signed in (Sign In)

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormllb
    • CommentTimeNov 22nd 2009
     
    Can you use formula's in a calculated field to fill with a previous answer of the form?

    Specifically,

    I ask for an address
    later I ask if this address should be same as prev address

    if Yes I would like the field filled with the prev addr and if not left blank

    Is this possible?
    • CommentAuthordbuschho
    • CommentTimeNov 23rd 2009
     
    Hello,

    This is possible, though it's a bit of work. You would need to make each of the first address fields a variable, as well as the 'yes' checkbox. Once that was done, in each of the repeated address fields formula box you would need to add code like:
    if(VAR_YESNO=='tfa_Yes'){VAR_ADDRESS}

    A better solution would be to make the second set of address data a conditional section based off the yes/no question. If yes, then nothing is displayed and the user doesn't have to look over the data again. If no, the blank address fields are displayed again to the user.

    This is basically the same idea as was most recently described by jlabau:
    http://www3.formassembly.com/forum/discussion/421/repeatable-answers/#Item_3
    • CommentAuthormllb
    • CommentTimeNov 24th 2009
     
    Thanks for the response. Both ideas are valuable but I really want to set up the more complicated first idea but having a little difficulty.

    Here is the code I am using
    if(tfa_SameaddressasPar='tfa_Yes1'){poneadd}

    This works to place the same info in both fields but if "No" is selected it still shows the "poneadd" info.

    Is there a way to make the field blank if "No" is chosen?

    (the parameter for a "No" answer is tfa_No1)
    • CommentAuthordbuschho
    • CommentTimeNov 24th 2009
     
    Hello,

    Your formula is incorrect:
    if(tfa_SameaddressasPar='tfa_Yes1'){poneadd}
    says "If I can assign a string to variable tfa_SameaddressesasPar, return poneadd".

    What you want is something like:
    if(String(CALC_SAMEADD).replace(/0/g,"")=='tfa_Yes1'){poneadd}
    Which says "If the variable CALC_SAMEADD is equal to the string tfa_Yes1, then return poneadd"

    Happy to help further
    • CommentAuthormllb
    • CommentTimeNov 24th 2009
     
    OK now I am really confused. Appreciate your help but I'm just not getting it.

    Here is the URL to my form. http://www.tfaforms.com/128443

    Can you please have a look and tell me how I can make this work?
    • CommentAuthormllb
    • CommentTimeNov 24th 2009
     
    Now I have another issue. Seems I can not modify any of the the text areas on a few of my forms.

    Specifically look at this form http://www.tfaforms.com/128889

    I have several forms similar to this one that I can not see the properties of the text area in order to modify them. PLEASE HELP!!
    • CommentAuthordbuschho
    • CommentTimeNov 24th 2009
     
    Hello,

    In the form you reference above, there does not seem to be text areas. Can you give us more details on what you are trying to change?

    Happy to help,
    FA Support.
    • CommentAuthormllb
    • CommentTimeNov 24th 2009
     
    Basically the entire form is a text area. It starts with the line "Your registration is not complete"

    I actually have several forms with the same setup as this one and I can not change the info on any of them.

    Here are all the links.

    http://www.tfaforms.com/128559
    http://www.tfaforms.com/128889
    http://www.tfaforms.com/128451
    http://www.tfaforms.com/128452
    http://www.tfaforms.com/128884
    http://www.tfaforms.com/128885
    • CommentAuthordbuschho
    • CommentTimeNov 24th 2009
     
    Hello,

    I'm not quite sure what happened there. Your HTMLSections had their ids removed. It may have been a browser error. Can you tell us which browser/version you were using?

    In any case, I reassigned ids to the sections and they began working properly.

    Let us know if the problem recurs.

    FA Support.
    • CommentAuthormllb
    • CommentTimeNov 24th 2009
     
    Firefox 3.5.5

    Thanks for the help.

    Any luck with the looking at the formula from the original post?
    • CommentAuthordbuschho
    • CommentTimeNov 24th 2009
     
    Hello, you had the code most of the way there. I had to go into your form, and adjust the 'Same as first parent' choices to be a variable, called 'SAMEASFIRST' and I changed your formula from having '=' to the quality test '=='.

    The formula is now:
    if(String(SAMEASFIRST).replace(/0/g,"")=='tfa_Yes1'){poneadd}else{""}

    Which I think should work.
    • CommentAuthormllb
    • CommentTimeNov 24th 2009
     
    This worked great with one minor change.

    It seems
    "This is a multiple-choice question. Please assign a numeric value for each choice.

    Yes =
    No ="
    section was added recently or I did not see it previously.

    Therefore by assigning a value of 1 to yes and 0 to no I was able to make the formula work correctly with a slight modification.

    So the correct formula for this operation is

    if(String(SAMEASFIRST).replace(/0/g,"")=='1'){poneadd}else{""}

    Thank you very much for your fast response.