Custom fields not cleared when form reloads

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
sp119
Posts: 23
Joined: Wed Feb 13, 2013 1:55 pm

Custom fields not cleared when form reloads

Post by sp119 »

Script URL: s1.grad.gatech.edu/hesk/
Version of script: 2.8.2
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: Clear custom fields
Write your message below:

We are starting to get walk-in traffic and want to have these folks fill out a help ticket in a specific category (walk-in). We plan to have a computer setup in Kiosk mode to load just this form: http://s1.grad.gatech.edu/hesk/index.ph ... category=4 (this is on our test environment, not production).

Once the person completes and submits we want to have them click on "Home" and it will go back to this form. All of this works, however, when the form reloads the custom fields are not cleared out. Their name, email and other regular form items are all cleared out but any custom fields keep the data from when the form was last submitted.

Is there some way to force these fields to also be cleared out? We already use Hesk as our helpdesk and would like to just expand on it with our walk-in folks. However we can't have any of the fields show previous person's data so I need to figure out a way to flush these fields when the form reloads.

Any ideas greatly appreciated. I've tried setting browser settings to not save any form data and I've even run the form in privacy mode but the custom fields won't clear unless you close and re-open the browser. Need them to clear without closing and re-opening the browser.
Sean Porter
Web Developer/Business Analyst
Georgia Tech
mkoch227
Posts: 666
Joined: Wed Jul 04, 2012 3:37 pm

Re: Custom fields not cleared when form reloads

Post by mkoch227 »

It looks like the custom fields are not properly cleared from the session, which is why they persist when loading the create ticket page. I haven't tested this fix, but you can try making the following change to submit_ticket.php and see if it works properly without errors (make a backup of your current submit_ticket.php file you can revert to in case this doesn't fix the issue :wink: ):

Find:

Code: Select all

hesk_cleanSessionVars('img_verified');
Just after that line, add the following:

Code: Select all

foreach ($hesk_settings['custom_fields'] as $k => $v)
{
    hesk_cleanSessionVars("c_$k");
}
Mike, Lead Developer of Image HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
sp119
Posts: 23
Joined: Wed Feb 13, 2013 1:55 pm

Re: Custom fields not cleared when form reloads

Post by sp119 »

Mike,

Yep, that works! Thanks I appreciate the quick response!!
Sean Porter
Web Developer/Business Analyst
Georgia Tech
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: Custom fields not cleared when form reloads

Post by Klemen »

It's not a bug, it's a feature :)

This was actually by design. It may be better to add a setting in the future to allow Hesk admin to control this behavior.

Thanks Mike for providing a quick work-around.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply