Client side validation

Hi, we have dynamic page in our website that is apply online for choosing course. in that we need to do client side validation.if we missed out any required field it should ask for the value and it should not allow the users to enter the next field.

for this we used Required syntax to perform the client side validation. in our dynamic page we have maximum team size as 4. if any team with 4 members like to choose our training programs it eill ask for their details. for each applicant we have seperate tabs to fill their details.

but when we use these required syntax command,its allowing only if the 4 applicants details are filled. if there is only 2 applicants in the team the website not allowing them to register.

kindly help us to resolve this

For more complex client-side validation, where requirements are dependant on the input of other fields, you will need javascript.
The html validation via the various attributes are fine for simple validation where the inputs are independent of one another.

In the screenshot I see a “teamsize” select, couldn’t you use that as a “css function” to show only the necessary number of form tabs?

If the current form is made in four versions, each having the necessary number of “applicant tabs” avaiable and showing non existing tabs “grayed out”, then the “teamsize” selector could be used to only display the form that corresponds to the select value.

The select could be radiobuttons and wouldn’t be part of any of the four forms as they would have the choosen teamsize in a hidden field.

It wouldn’t take too much code to change to make that happen, I guess, and the page layout would be the same. Only the select would be different.

Just my two cents. :slight_smile:

Edit)
Imho, the field requirements are preferred, javascript validation can’t be trusted.

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