Realtime calculator updates

Hi all!

I’m fairly new to Axure and I’m trying to create a basic calculator which gives a cost estimate for a house move, but updates in realtime, without a submit button.

I’ve attached a screenshot, so the idea is the the total cost would equal:

Property Price: x0.25 (i.e. £500,000 x 0.025 = £12,500)
No. of bed: +£50 (i.e. 3 bed button = £150)
Property Distance: + £2 per mile (i.e. 50 miles = £100)

In the example above the total cost would equal = £12,750.

Can anyone advice on the formulas I would need to get this to work, or if it’s even possible for it to work?

Thank you!! :slight_smile:

Hi, I assume it will work :wink:
Just use local variables. But the action itself must be triggered by something. In this case I think property distance is mandatory field and it can trigger (OnFocus) the calculation itself and put it as PropertyPrice text , right ? That way you can fake realtime calculation. And then if you change for example No of beds the action will be triggered by OnClick on button itself etc.Just the idea.

Karel

Sorry I’m a real newbie, so I’m not sure how to do that!

I’ve worked out the property price field using:

On lost focus
Set Text on ‘Total cost - number’ equal to [[This.text * 0.025]]

However, when i’ve tried to use a similar for a no. of beds buttons it doesn’t work, only shows the formula. This is the formula I tried which didn’t work:

On click
Set text on ‘Total cost - number’ equal to [[propertyprice.text + 50]]

Don’t know what to do :frowning:

How can I reference the property price field? I.e. take the calculation from the property price field & add 50 to it?

Thank you!

Edit I see PierreJ was faster :smile:

interaction pane click Set text and in value type your expression. You can reference to other widget by using Text on widget too. But its same as enter Local variable [(LVAR1)] and then reference to it by value [(LVAR1)] like

Set text on YourField equal to [(LVAR1)]
LVAR1 = text on widget PriceField

Karel

Hi @Adrian1,

Add a local variable to reference to the text of your widget, the one wich contains the property price value:

Best,

Thank you both for your help!

I’m sorry, I really am new to this… @PierreJ, where do I click to get the Edit Text modal you’ve shown in your attachment?

On the “fx” icon:

The Axure’s UI is not really easy to read. There’s always somthing new to be discovered :confounded:

Brilliant! Again thank you for your help.

One last problem :slight_smile:

I’ve managed to reference the property price & add the no. of bed fields to it to change the total cost in real time… great!

Only problem is I’ve now got to add the ‘property distance’, which needs to reference the property price & whatever no. of beds the user has selected, then * 0.002 whatever value to user enters into the ‘property distance’ field.

Apologies if I haven’t explained that very well, but if you’ve got any advice it would be really appreciated! Thank you so much!!

Hi Adrian1,

I believe you would do this using the same local variable method as mentioned above, i.e. by referencing the text on the property price and the # of beds the user has selected, but if you’re able to post your RP file here, I’ll be able to offer some more targeted assistance. :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.