Good Morning to KK Sir and All Couchies!
I am creating a user registration (extender users module). I have an editable defined as:
in the users/index.php
Using this editable as my conditional field I have:
But in me users/register.php I am actually using the code as:
as i only want 2 options to be available during registration.
The issue is that, when i try to register the emp_id and status_active fields are showing to be required, which should not. Only the fields company_name and active_status_dr should appear if i select the "Dealers & Retailers" option from the dropdown on my users/register.php page. (image attached)
How can i handle this issue?
Regards,
GXCPL (CTR)
I am creating a user registration (extender users module). I have an editable defined as:
- Code: Select all
<cms:editable name="user_type" label="User Type" type="dropdown" opt_values="Select=- | Support=0 | Administrator=1 | Service Desk Executive=2 | Retail Counter Executive=3 | Dealers & Retailers=4 | Customer=5" opt_selected="-" required="1" order="1" />
in the users/index.php
Using this editable as my conditional field I have:
- Code: Select all
<cms:func _into="cond_user_type_emp" user_type="">
<cms:if ((user_type eq '2') || (user_type eq '3'))>
show
<cms:else />
hide
</cms:if>
</cms:func>
<cms:editable name="account_info" label="Account Information (Employee)" not_active=cond_user_type_emp type="group" order="4" />
<cms:editable name="emp_id" label="Employee Id" type="text" group="account_info" not_active=cond_user_type_emp required="1" order="1" />
<cms:editable name="doj" label="Date of Joining" type="datetime" format="Ymd" group="account_info" not_active=cond_user_type_emp order="2" />
<cms:editable name="reporting_manager" label="Reporting Manager" type="dropdown" opt_values="Select=- | <cms:pages masterpage='users/index.php' custom_field="user_type != 0"><cms:show fname /><cms:if mname> <cms:show mname /></cms:if> <cms:show lname />=<cms:show k_page_id /></cms:pages>" has="one" group="account_info" not_active=cond_user_type_emp order="3" />
<cms:editable name="active_status" label="Active Status?" type="dropdown" opt_values="Select=- | Yes | No" opt_selected="Yes" group="account_info" not_active=cond_user_type_emp required="1" order="4" />
<cms:func _into="cond_user_type_dr" user_type="">
<cms:if (user_type eq '4')>
show
<cms:else />
hide
</cms:if>
</cms:func>
<cms:editable name="account_info_dr" label="Account Information (Dealer/ Retailer)" not_active=cond_user_type_dr type="group" order="4" />
<cms:editable name="company_name" label="Company/ Shop Name" type="text" group="account_info_dr" not_active=cond_user_type_dr required="1" order="1" />
<cms:editable name="dr_gstin" label="GSTIN" type="text" format="Ymd" group="account_info_dr" not_active=cond_user_type_dr order="2" />
<cms:editable name="dr_pan" label="PAN" type="text" group="account_info_dr" not_active=cond_user_type_dr order="3" />
<cms:editable name="active_status_dr" label="Active Status?" type="dropdown" opt_values="Select=- | Yes | No" opt_selected="Yes" group="account_info" not_active=cond_user_type_dr required="1" order="4" />
But in me users/register.php I am actually using the code as:
- Code: Select all
<cms:hide>
<cms:input name="user_type" id="user_type" type="bound" />
</cms:hide>
<div class="form-floating mb-3">
<select name="f_user_type" id="f_user_type" class="form-select" aria-label="User Type">
<option value="-" selected>Select</option>
<option value="4">Dealers & Retailers</option>
<option value="5">Customer</option>
</select>
<label for="user_type" class="bcw-text-primary">User Type <span class="text-danger">*</span></label>
<cms:if k_error_user_type>
<span class="text-danger">
Required
</span>
</cms:if>
</div>
as i only want 2 options to be available during registration.
The issue is that, when i try to register the emp_id and status_active fields are showing to be required, which should not. Only the fields company_name and active_status_dr should appear if i select the "Dealers & Retailers" option from the dropdown on my users/register.php page. (image attached)
How can i handle this issue?
Regards,
GXCPL (CTR)