Required fields according to other dependent fields |
9/28/2022 3:48:52 PM |
PHPRunner General questions | |
A
alfonso authorDevClub member
I have a mandatory field called "country" (lookup wizard with all countries) and another mandatory field that is "province". This is a "lookup wizard" type field, but only with the provinces of Spain. If the country Spain is chosen, then the provinces of Spain appear in the second field. And it is mandatory to complete it. But if any other country is chosen, there are no options available in the province field, so, being a mandatory field, it does not allow us to complete the registration. |
|
![]() |
Admin 9/28/2022 |
You can make a field/control to be required or not required using Javascript API. Use addValidation() function. Btw, Google search for "phprunner make field required" makes wonders. |
A
|
alfonso authorDevClub member 9/28/2022 |
Thanks. Do you mean I must put the code in Events -> (table_name) -> Edit -> Javascript Onload Event? |
A
|
alfonso authorDevClub member 9/28/2022 |
I've got it with: var F1 = Runner.getControl(pageid, 'residencia'); But although the F2 field is no longer mandatory, the asterisk still appears in the label and can generate doubts |
![]() |
Admin 9/28/2022 |
You can always use a different type of a lookup wizard, i.e. AJAX list page with search |