0

In Form-Builder, I have a choice of fields for a Credit Card or Bill Payment Type.

Depending on what is selected, other form fields will be loaded i.e. CC-Number or Bank Account.

I need the CC-Number input to be a required field, if Credit Card is selected. How can I achieve this?

2 Answers 2

1

You can follow this cookbook entry for the backend side, the Javascript code needed on the client side is up to you.

Sign up to request clarification or add additional context in comments.

Comments

1

I found a solution that fits my needs by myself:

If a field is required it has the attribute required="required". So i did a little piece of jQuery, which removes or adds this attribute on elements that are hidden or shown.

2 Comments

This is just client side validation. You should not rely on this.
I'm now using a jQuery Validation Plugin and serverside validation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.