Conditional Forms (aka Form Logic)


#55

Hi @Gary_Michael

Is there any chance you could share the JavaScript and style that you customized. I’m not very advanced in this area so I’m not entirely sure what you have included in each before you go into what to add.

Any help is greatly appreciated!

@Jess - if you know what JavaScript and style is being referred here, that would be very helpful.


#56

hi @Joe_Savitch - I am looking for the script that you used this page as an example for.

Even if you don’t have the link to the original script, do you have a starting point? I’m not super advanced in JavaScript but can figure it out based on a code starting point.


#57

Leslie,

Here is the script I used, make sure you place it in the head:

The #how_would_you_like_to_be_contacted is the id of the first field

#time_day show/hide is what shows hide based on what they select.

Good Luck!

If you are looking to do something uber complicated I highly HIGHLY recommend Formstack. Conditional logic is built in and it integrates very nicely with Unbounce.

<script type="text/javascript">
$(document).ready(function () {
    showhideFields();
    $("#how_would_you_like_to_be_contacted").change(function () {
        showhideFields();
    });

});

  //this toggles the visibility of our company field based on our Income field value
function showhideFields() {
    if ($("#how_would_you_like_to_be_contacted").val() == "Phone" )
        $("#time_day").show();
    else
        $("#time_day").hide();
}
</script>

Conditional form field that hides options
#58

Thank you so much for sharing this @Joe_Savitch!! :smiley:


#59

We need to gather State and County in our forms in order to route leads to specific regional offices. We cannot display a massive list of US counties, so we need some javascript that will allow for displaying, or perhaps ‘Un-Hiding’ a custom dropdown menu based on the State input that is chosen. Any javascript wizards out there that can help?

As a feature suggestions - conditional logic would be a KILLER UPDATE for Unbounce!


#60

Hey there - I’ve got a form where someone enters their state. If they enter a specific state, say Hawaii, I’d like them to go to a different page after submitting the form, and everyone else goes to a default page after submit.

How can I do this?


#61

Hi! I added a form in Unbounce. I want to show different thank you pages according to the fields selected by the user in select dropdown list. I want that if user select the first option then a different page opens and if second option then the other one. May it possible.


#62

Hi! I am trying to build form logic into my landing page. And what I mean by that is, the lead can select an option in the first field and that option will determine which options show up in the second field. I do not want to send them to another form/page, because from the testing we have done, this leads to more drop-offs than actual conversions.

An example of what I am talking about:
Field A: Location
    Options: A, B, C
Field B: Degree Programs
    Options: Depending on which location they chose, show the degree programs offered at that location.

Please help! Thanks!


#63

I have seen that it is possible to now create a multistep form by going to another page but is there anyway you can make the steps conditional i.e. on the landing page having a single line drop down menu with a list of pages that the visitor can then choose from?


#64

Wondering if there is a way to make the dropdown options in one form field conditional on the selection from a previous form field. Example  - our client is real estate - property type options are apartment, townhouse & villa - price drop down options need to reflect this - if someone selects apartment I want the price options to start at a much lower price than if they select villa - same with bedrooms - there are no 1 bedroom villas - and I want to avoid someone requesting that

any ideas?


#65

Is it possible to add dynamic fields so for example, if the user wanted to add 3 phone numbers they could just hit a plus symbol and another field would become visible?


#66

Hi - what is the best tool to use to create a dynamic “form” on my unbounce page? For example, we’d need consumers to input 5 data points at the specific page I’m talking about it.


#67

Hi all

I have recently tested a ‘Let us contact your relevant friends’ form for event campaigns around the globe. This has been very successful in leads but as an agency, we only receive money from registrations not leads. After looking at the stats, I believe we could get 5% increase in event registration without any further advertising cost from a ‘Register a friend’ but I would have to have individual thank you pages for each event which would all need manual developer links to my clients system which is will add cost & time that will equal the benefits so is pointless. Equally a non-Unbounce taliored form would have an equal cost/hassle issue.

The solution is a Unbounce Conditional form on the original landing page which says ‘invite a friend’ then expands (would need required fields for name, email). This is a solution for myself but I’m sure looking at my stats, it would help others too so is this something Unbounce could build, anyone has any answers or know any partners that could build this within my Unbounce interface because it would be worthwhile at a one-off cost. 


#68

HI @Joe_Savitch - I have something almost exact to that for my script… but I think I’m missing some thing in the style sheet perhaps that hides the forms until the script is called? Right now I have this exact script (with different fields) and the page looks exactly the same as when it doesn’t.


#69

Can I apply this script if my form is based on Radio buttons instead of a dropdown list?


#70

Hey @Johnny_Opao, this post was from over two years ago, but I wanted to see if you knew how to append URL parameters to the redirect links?

In other words… In your example, you are redirecting to Google and Bing based on gender. If the landing page was www.unbounce.com/?utm_source=facebook&id=2890284jd8, how could I redirect to these:

http://www google.com/?utm_source=facebook&id=2890284jd8
http://www bing.com/?utm_source=facebook&id=2890284jd8

The idea being that the URL parameters will always be changing, so that would have to be dynamic.

Thanks in advance!