Script URL: http://www.slotdoctor.com/submit_ticket.php
Version of script: 2.5.3
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
Hi,
I noticed when customer submits a form, but forgets a selection (any "required" validation), the form generates an error (as designed), but any attachments that were attached to ticket are removed without the customers knowledge. They would then click submit again after correcting the missing selection, unknowingly submitting a ticket without the attachments (unless they happen to look at the attachments again before sending).
Also when using "check boxes" on form, they are also unchecked when an error is generated, forcing the customer to check them again before submitting form.
EXAMPLE: I have 2 check boxes that are "required selections" located just after the message box (Please See my URL provided). These "check boxes" will deselect automatically when another unrelated "required" option generates a validation error.
I tried to use radio buttons, but when only ONE radio button is used, it is pre-selected. This won't work for my needs.
I currently modified the code from my other post here: viewtopic.php?f=13&t=4280&hilit=radio+button+selected as I do not want radio buttons to be automatically checked. This works fine but only if there are more than one radio button option to choose from. Seems when one radio button used, it is selected.
Thanks for any help or suggestions you might be able to provide. Larry
PS- I use "spry Tabs" and iframe on website, but have the same problem the normal route. I provided links to both pages for you to see.
Form errors Will remove any attachments
Moderator: mkoch227
Form errors Will remove any attachments
Last edited by Lurking on Fri Jul 11, 2014 2:29 am, edited 2 times in total.
Re: Form errors Will remove any attachments
Unfortunately the attachments are indeed gone, it is not possible to reset them on the form after submitting it. To make this work attachments would have to be processed in the parallel (for example uploaded to a temporary folder and moved to the attachments after the from is successfully submitted). I am aware of the inconvenience and this is planned for a future update.
The way checkboxes currently work is that you need to enter at least 2 values under "Options". This is indeed another thing that needs to be fixed in the future. A temporary work-around might be to use a radio box instead with two values (Yes and No) and then verify that the correct selection has been made in the submit_ticket.php file above something like
The way checkboxes currently work is that you need to enter at least 2 values under "Options". This is indeed another thing that needs to be fixed in the future. A temporary work-around might be to use a radio box instead with two values (Yes and No) and then verify that the correct selection has been made in the submit_ticket.php file above
Code: Select all
if (count($hesk_error_buffer))
Code: Select all
if (hesk_POST('custom19') != 'Yes')
{
$hesk_error_buffer['custom19'] = 'Please mark that you have read the terms and conditions of this website';
}
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
Re: Form errors Will remove any attachments
Thanks for your reply!
Should I replace this line: "if (count($hesk_error_buffer))" with the code provided, or enter it below this line? Will this code verify "yes" must be selected if I use 2 radio buttons? Thank you, Larry
Should I replace this line: "if (count($hesk_error_buffer))" with the code provided, or enter it below this line? Will this code verify "yes" must be selected if I use 2 radio buttons? Thank you, Larry
Re: Form errors Will remove any attachments
Place the custom code above
The code sample Klemen provided should work without any issues if your custom field is #19.
Code: Select all
if (count($hesk_error_buffer))
Mike, Lead Developer of
HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
Re: Form errors Will remove any attachments
Thanks Mike,
I was inserting below that line (oops) and was able to do the same for other radio button by changing field number to "20". Thank you for your help with this. Larry
I was inserting below that line (oops) and was able to do the same for other radio button by changing field number to "20". Thank you for your help with this. Larry