• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Requiried fields depends on piority

Requiried fields depends on piority 14 years 7 months ago #8575

Hi there.

I have created some custom fields and i would like one or two of these to be requiried if the user selects high piroity. If the users selected low or medium piroity then the fields are optional.

Can some please point me in the right direction on how to do this?


thanks
The administrator has disabled public write access.

Re:Requiried fields depends on piority 14 years 7 months ago #8635

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

You will have to add this function in the javascript area of the add_ticket.php:
function rst_setHigh()
{
var bol = true;
if(document.getElementById('TicketPriority').value == 'high' && document.getElementById('id_of_your_custom_field').value == '' && document.getElementsByName('DepartmentId')[0].value == 'name_of_the_department_here')
	{
		alert('Please fill in the custom_field_name_here');
		bol = false;	
	}
return bol;
}
 
You will also have to use this:
 
	<p><?php echo ((isset($users) && count($users) > 0 && count($departments) > 0) || (!isset($users) && count($departments) > 0)) ? '<button type="submit" class="submitTicket" onclick="return rst_setHigh();">'.LBL_SUBMIT_TICKET_BTN.'</button>' : '' ?></p>
 
instead of:
 
	<p><?php echo ((isset($users) && count($users) > 0 && count($departments) > 0) || (!isset($users) && count($departments) > 0)) ? '<button type="submit" class="submitTicket" >'.LBL_SUBMIT_TICKET_BTN.'</button>' : '' ?></p>

Note that this script provides some general guide lines for the actual script that you may need.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!