HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Split required fields?


Is it possible to have a field which is required for the end users (in the web form), but NOT for tech who create requests? We’d like to have information that the end user MUST put it, but if we are creating a request on our own, we may not need that particular info…



Yes. Don’t set it as required in the admin. Then you’ll need to modify the request.tpl.php template and near the top you’ll see a hidden field where you can pass in the names of fields to be required. Put in there CustomX where X is the custom field ID which you can find in the left column of the custom field page.

Before modifying the template be sure to read the docs on doing so.


OK, thanks. That worked. One last question - is it possible to have the custom field on the request page be one thing (like a question), but on the admin/tech side be something else (like just a single word)?


On request page: "Have you rebooted your machine?"
On tech page: “Rebooted”



Sure, just a bit more customization. In the request page template you’ll see a loop around line 120. Inside the loop each custom field is labeled (around line 124). By default it just outputs the field name with <?php echo $field['fieldName'] ?>. However, you could add more logic here if you wanted. So something like this

<?php if($fieldID == "Custom2"){ echo 'Have you rebooted your machine?'; }else{ echo $field['fieldName']; } ?>

What this would do is show your custom wording when the loop reaches the custom field with ID 2, but for all others would display the normal field label. If you wanted you could do this for each field by using elseif().


This worked fine, thanks. You might want to add that into a future version - just add an additional db field for request display and have the php code check for a value there.

Thanks again.


Thanks, I’ll note that for consideration in a future release.