Back

Form Maths

This code creates a calculator for websites. It uses a custom formula to figure out a value based on what users type into different input fields. The formula can do simple math and make choices based on conditions. The tool updates the result whenever users change their inputs. It can show the calculated value and, if needed, extra information to help fix any problems. This calculator is flexible and can be used for various purposes on a website.

Status

Working

Code Component

Yes

Preview

Preview

Preview

This component is a part of the 300+ components, layouts and code overrides from the SegmentUI KIt. Learn More. We also have a library of freebies here

0:00 / 0:00

Instructions

  1. Remember the "Name" of each form field

  2. Use the "Name" to make conditional and variable formulas

  3. Use debug=on to debug variables

  4. Use the existing templates as a base to make calculations

How it Works

The Formula control allows you to define the calculation logic used by the Project Value Calculator. You can create complex formulas using conditional statements and variables. For example:

  • Basic Calculation:

    • Formula: pages * 1000

    • Explanation: This formula multiplies the number of pages (input field named pages) by 1000. If you enter 5 in the pages field, the calculated value will be 5000.

  • Conditional Calculation:

    • Formula: if (complexity === 'Easy') { pages * 500 } else { pages * 1000 }

    • Explanation: This formula checks the value of the complexity field. If the complexity is 'Easy,' it multiplies the number of pages by 500; otherwise, it multiplies them by 1000. For example, if you select 'Easy' and enter 4 pages, the value will be 2000.

  • Nested Conditions:

    • Formula: if (type === 'Web') { if (complexity === 'Easy') { pages * 1000 } else { pages * 2000 } } else if (type === 'Mobile') { if (complexity === 'Easy') { pages * 100 } else { pages * 200 } } else { 0 }

    • Explanation: This more complex formula first checks the type of project (Web or Mobile). If it's a web project, it further checks the complexity and calculates the value accordingly. For instance, a 'Web' project with 'Easy' complexity and 3 pages would yield a value of 3000.

Frequently Asked Questions

I'm having issues with this component. What should I do?

I'm having issues with this component. What should I do?

I'm having issues with this component. What should I do?

How can i make this responsive?

How can i make this responsive?

How can i make this responsive?

0:00 / 0:00

What is SegmentUI Pro?

SegmentUI Pro is a UI kit and component library containing 500+ assets, components, power ups, upgrades, code overrides, layouts, design systems, Premium templates and a custom Framer code generator. You can preview the UI Kit here.

Additionally, we have a Figma Design system to compliment the Framer components.

Our mission is simple - give superpowers to designers. Everything from the first pixel, education to code components. It's an ever growing, ever evolving set of tools for designer without the hefty price tag.

vs

Who is SegmentUI Pro For?

SegmentUI Pro is for Framer designers and template creators who want to power up their designs

After creating multiple templates and client projects myself, I realised one thing - In order to make more revenue, you need to give more value. This was the main intent behind SegmentUI. To empower designers and to be able to allow them to deliver more value for the time they spend

SegmentUI Pro is for Framer designers and template creators who want to power up their designs

After creating multiple templates and client projects myself, I realised one thing - - In order to make more revenue, you need to give more value. This was the main intent behind SegmentUI. To power up designers to and to be able to allow them to deliver more value for the time they spend

SegmentUI Pro is for Framer designers and template creators who want to power up their designs

After creating multiple templates and client projects myself, I realised one thing - - In order to make more revenue, you need to give more value. This was the main intent behind SegmentUI. To power up designers to and to be able to allow them to deliver more value for the time they spend

For Framer

For Figma

Resources

Loved by Designers, Developers and Founders

See what our 3500+ customers have to say

Unlock everything with a one time payment

For the fraction of your next project, you can boost your workflow by 10 folds

Happy ! Use discount code for a special holiday discount!

Pro

$99

One Time Payment

Full Access to the Figma UI Kit

Full Access to the Framer UI Kit

Full Access to the Framer Code Components & CMS Upgrades

Full Access to 4 Premium Framer Templates

Full Access to Framer Code Genie GPT

Request Components & Layouts

Get Updates Forever

Light, Dark & Dynamic Modes

Use for Unlimited Projects

Commercial License Only

Use for personal and client projects

Pro Creator

$199

One Time Payment

Everything in Pro

Template & Commercial License

Use UI Kit to create unlimited client projects and templates

Frequently Asked

For anything not covered here, mail us at hello@segmentui.com

General

What is SegmentUI?

Is it for Figma or Framer?

How do I access after purchasing?

License

Can I use it to create client projects?

Can I use it to create Framer templates?

Pricing

Is there a free version?

Do you have a student discount?

Can I buy components seperately?

Will I get future updates if I purchase now?

Is this a one time payment or a subscription?

What is the difference between Pro and Pro Creator Access?

Supercharge Your Design Workflow

1000+ variations of styles, components, interactions, layouts, transforms, code overrides, code components for Framer & Figma. Power Up Now!

Loved by Designers, Developers and Founders

See what our 3500+ customers have to say

Unlock everything with a one time payment

For the fraction of your next project, you can boost your workflow by 10 folds

Happy ! Use discount code for a special holiday discount!

Pro

$99

One Time Payment

Full Access to the Figma UI Kit

Full Access to the Framer UI Kit

Full Access to the Framer Code Components & CMS Upgrades

Full Access to 4 Premium Framer Templates

Full Access to Framer Code Genie GPT

Request Components & Layouts

Get Updates Forever

Light, Dark & Dynamic Modes

Use for Unlimited Projects

Commercial License Only

Use for personal and client projects

Pro Creator

$199

One Time Payment

Everything in Pro

Template & Commercial License

Use UI Kit to create unlimited client projects and templates

Frequently Asked

For anything not covered here, mail us at hello@segmentui.com

General

What is SegmentUI?

Is it for Figma or Framer?

How do I access after purchasing?

License

Can I use it to create client projects?

Can I use it to create Framer templates?

Pricing

Is there a free version?

Do you have a student discount?

Can I buy components seperately?

Will I get future updates if I purchase now?

Is this a one time payment or a subscription?

What is the difference between Pro and Pro Creator Access?

Supercharge Your Design Workflow

1000+ variations of styles, components, interactions, layouts, transforms, code overrides, code components for Framer & Figma. Power Up Now!

Loved by Designers, Developers and Founders

See what our 3500+ customers have to say

Unlock everything with a one time payment

For the fraction of your next project, you can boost your workflow by 10 folds

Happy ! Use discount code for a special holiday discount!

Pro

$99

One Time Payment

Full Access to the Figma UI Kit

Full Access to the Framer UI Kit

Full Access to the Framer Code Components & CMS Upgrades

Full Access to 4 Premium Framer Templates

Full Access to Framer Code Genie GPT

Request Components & Layouts

Get Updates Forever

Light, Dark & Dynamic Modes

Use for Unlimited Projects

Commercial License Only

Use for personal and client projects

Pro Creator

$199

One Time Payment

Everything in Pro

Template & Commercial License

Use UI Kit to create unlimited client projects and templates

Frequently Asked

For anything not covered here, mail us at hello@segmentui.com

General

What is SegmentUI?

Is it for Figma or Framer?

How do I access after purchasing?

License

Can I use it to create client projects?

Can I use it to create Framer templates?

Pricing

Is there a free version?

Do you have a student discount?

Can I buy components seperately?

Will I get future updates if I purchase now?

Is this a one time payment or a subscription?

What is the difference between Pro and Pro Creator Access?

Supercharge Your Design Workflow

1000+ variations of styles, components, interactions, layouts, transforms, code overrides, code components for Framer & Figma. Power Up Now!