I hope someone can help me because my tiny little brain is bamboozled!

What I want to do:

  • Use webform with multiple page breaks to allow site visitors to enter information such as text and numbers
  • Once a user enters a number (x) on page 2, that information is displayed on page 3 via a token
  • Said number (x) is then multiplied by 75% and displayed as another number (y)
    i.e. Thank you for your interest. Your property is worth number (x) and we can offer you number (y) today
  • Tick box is selected by user to confirm happy to submit completed form, before pressing submit to complete

What I can do:

  • Use webform with multiple page breaks to allow site visitors to enter information such as text and numbers
  • Once a LOGGED IN/AUTHENTICATED user enters a number (x) on page 2, that information is displayed on page 3 via a token
    i.e. Thank you for your interest. Your property is worth number (x)
  • Tick box is selected by user to confirm happy to to submit completed form, before pressing submit to complete

What I can't do:

  • Once an ANONYMOUS user enters a number (x) on page 2, that information is displayed on page 3 via a token
  • Number (x) is then multiplied by 75% and displayed as number (y)
  • i.e. Thank you for your interest. Your property is worth number (x) and we can offer you number (y) today

:-( I hope that's in depth enough. In a nutshell, I have 'Drafts' option set up on advanced settings (thanks for your help there quicksketch) and as such using %value[property_value][estimate] is being shown properly when used by an authenticated user, but an anonymous user is just shown the token and not their previously inputted value.

As far as the multiplication element goes, I know this is probably being cheeky but any help would be much appreciated. I have got as far as adding a PHP filter and doing a basic maths equation. When I type numbers into the equation, i.e. 4 * 5, it works fine. However 'token' * 5 just displays 0, I'm guessing it's ignoring the token value and treating it as 0. I have tried setting up the field as an integer and textfield without any success :-(

Comments

stuhannaford’s picture

I've worked around it in the end. Anybody interested this is what I did:

  1. Split overall webform in two at the point at which I wanted to access submitted information so that regardless of whether the user was authenticated or anonymous, the data was submitted and stored and accessible
  2. Then I redirected first form to second with a custom URL with tokens of number(x) I needed via the URL (node/21?propest=%value[property_value][estimate]) which meant I could grab info from URL from the token I wished to use
  3. Then I used PHP filter in text area to pull in previously inputted number(x) from URL by print $_GET["propest"]
  4. Then I multiplied with PHP maths calculation to provide number(y)

If anyone wants to see it in action, please visit http://www.fasthousesellnow.co.uk

quicksketch’s picture

Status: Active » Fixed

As this solution requires custom code, it's unlikely that any further updates will be made here (since I don't give support on custom coding in the Webform issue queue).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.