Preventing a form submit based on the answer to a question

Hey all!

Is there a way to prevent a form submission based on the answer to a question within the form?

For example, I don’t want someone to be able to submit a form if they select “yes” for a as the answer to a question at the end of the form.

1 Like

Welcome, @lobauman,

One way to prevent a form submission is make a single-select question required and include only one option value; the form Submit button will be active only if that single choice is selected.

This works for a question like “I agree with the terms” and a single option value, “Yes.” Unless they select that, they can’t submit the form.

I’m not sure the question you have, and it may be tricky for phrase it in the negative, but that’s an option.

Thanks,

Larry

2 Likes

Ahh great tip! That could work. We’re hoping to try to block folks from submitting a certain request form if their delivery date is sooner than our SLA allows (see below). But I suppose I could add that flag to the question description and it’ll just always be present. We’ve had folks ignore the warning and submit anyway, so trying to figure out the best way to redirect them.

You could do that, but it won’t prevent form submission.

It’s hard to convey in a Forum, but you have two tools in Asana forms that could help:

  1. Form branching (if you’re on Advanced/Business plan or above, and
  2. Required fields

The former can help deliver a message like you showed above.

The latter can disable the submit button when phrased correctly.

Dang, so one or the other. Required fields solves the no-submission-allowed issue though, so thank you for the help and quick responses!

They’re not mutually exclusive, so you could use both tactics. I was just pointing out a potential shortcoming of what your screenshot seemed to show.

Yeah there’s got to be a way to have some combo of both, maybe with an additional question to drive the branching logic with the :stop_sign: flag, and then the second required single select question to prevent the submit.

1 Like

Yes, exactly!!

1 Like

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