Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7532377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:26:03+00:00 2026-05-30T05:26:03+00:00

I have a form that performs calculations live as the user enters data. However,

  • 0

I have a form that performs calculations live as the user enters data. However, some of the calculations require that certain fields are filled out first.

For instance, if I have 4 fields, and field 4 is a percentage of field 1, I have to make sure that the user has a value for field 1 before they can enter data into field 4.

One thought I have is to give each field a data-step attribute with a sequential number. When the form first comes up, all the fields are disabled except the first field. When valid data is entered into the first field, the fields for the next step are enabled. This also assumes that if the user then blanks out field 1 that the rest of the fields are then blanked out and disabled again.

I’m pretty certain this solution would work, but would require a decent amount of JS code (jQuery) to ensure it works properly, as well as server-side validations. But one “gotcha” that I’m slightly puzzled on is if you do a submit and server-side validation fails and you render the form again, how to maintain the disabled/enabled state of the form fields? But I guess I’ll deal with that problem after the current one.

So the question is, is this a decent solution to the problem of forms that must be filled out sequentially? Has anyone else found a better solution or a more elegant method than what I’m planning on implementing? I’m fine with generic concepts or ideas; I can pretty much code anything I need, I’m just not sure of best practice to this particular problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:26:05+00:00Added an answer on May 30, 2026 at 5:26 am

    It seems that you don’t need to check an order but rather need to rule out the cases of form filled wrong (e.g. field 4 is filled, and field 1 is not).

    I suggest you to allow user to enter anything they want, but to highlight the required fields as long as they’re empty and to prevent form submittal until everything is correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that requires the user to enter some information. If they
I have a form on my PHP page which performs some ajax validation (that's
I currently have form that checks if a user has unsubmitted changes when they
I have a form that has multiple fields, and for testing purposes is there
i have this problem: I have created a bash script that performs some tasks.
I have a form (that consists of 25+ fields) and the values for these
I have a script that updates a CSS file based upon some user input
I have a script that performs some simple editing which works fine, the problem
I have some (php) code that performs critical updates on an InnoDB table. I'm
I have a form that performs 3 separate tasks when submitted. When the form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.