Page 1 of 1

Custom select/radio feilds - inserting a null

Posted: Tue Apr 19, 2011 2:55 pm
by joeyh
Script URL: https://support.altonschools.org/Tech/
Version of script: 2.2
Hosting company: Self hosted (IIS on Win2k3)
URL of phpinfo.php: http://support.altonschools.org/phpinfo.php
URL of session_test.php:
What terms did you try when SEARCHING for a solution: "select", "null value", "null default"

Write your message below:

We're using Hesk as an internal help desk to manage reports of computer problems within our school district. We have a custom select field which allows a user to select which campus they are at. However, a lot of our users are ignoring this and just leaving it set to the first option on the list. Is there an option somewhere that will let us set the default option of a select or radio option to be a null value, forcing a "missing field" error when they neglect to select a value?

Re: Custom select/radio feilds - inserting a null

Posted: Tue Apr 19, 2011 7:31 pm
by Klemen
You can try modifying index.php file: chnage

Code: Select all

<select name="'.$k.'">
to

Code: Select all

<select name="'.$k.'"><option value="">- Click to Select -</option>
It's locted twice in the file.

You will also need to remove

Code: Select all

strlen($k_value) == 0 || 
twice - remove the ones just below the code you modify, not any other ones!

Re: Custom select/radio feilds - inserting a null

Posted: Wed Apr 27, 2011 3:02 pm
by joeyh
That worked like a charm, thank you :D

Re: Custom select/radio feilds - inserting a null

Posted: Thu Oct 24, 2013 9:45 am
by snifty
This trick still works in 2.5.2.

Although the first line change looks like that:

Code: Select all

<td width="80%"><select name="'.$k.'" '.$cls.'><option value="">- Click to Select -</option>';
The second change keeps the same like mentioned from Klemen.