Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1

I am creating a data bound form. The form has a section for personal and business information. All fields in either of the sections are compulsory.

The use case now is that not people will have businesses. Some may be submitting the form to start a business. So I was wondering that if all editable regions are required so how do i get the condition to work.

This is my thought:
Code: Select all
<cms:if have_business=='1'>
     <!-- Bound part of the form for Business details goes here -->

But i get stuck at two things:
1. How to get the have_business condition to be checked before submitting the form.
2. All fields are required so if the have_business==0 then how to submit the form.

What can be done.

where innovation meets technology
Hi Aashish,

Following thread discusses ways of conditionally making a field 'required' -

I think you should be able to adapt it work for multiple fields in your use-case.
The idea is to define the business fields as non-required to begin with. Once the 'has_business' condition becomes true (perhaps you have a checkbox for this), then use PHP to toggle 'required' bit.

Hope it helps.
Thanks sir.
Will give it a try and get back.

where innovation meets technology
3 posts Page 1 of 1

Who is online

In total there are 2 users online :: 1 registered, 0 hidden and 1 guest
(based on users active over the past 5 minutes)

Users browsing this forum: Google [Bot] and 1 guest