Page 1 of 1
Allowing a field not to be filled in.
Posted: Tue Oct 26, 2010 12:10 pm
by Stephan1992
Script URL:
Version of script:
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:
Hey,
I created another message box, as in message2, but when i dont fill it in, at new_ticket.php, it doesn't send. It gives me an error of which i'm certain is about the message2 field. How do i allow that field to be empty?
Greets
Re: Allowing a field not to be filled in.
Posted: Tue Oct 26, 2010 1:03 pm
by Stephan1992
Code: Select all
$tmpvar['name'] = hesk_input($_POST['name']) or $hesk_error_buffer[]=$hesklang['enter_your_name'];
$tmpvar['email'] = hesk_validateEmail($_POST['email'],'ERR',0) or $hesk_error_buffer[]=$hesklang['enter_valid_email'];
$tmpvar['category'] = hesk_input($_POST['category']) or $hesk_error_buffer[]=$hesklang['sel_app_cat'];
$tmpvar['priority'] = ($hesk_settings['cust_urgency'] ? intval($_POST['priority']) : 3) or $hesk_error_buffer[]=$hesklang['sel_app_priority'];
$tmpvar['subject'] = hesk_input($_POST['subject']) or $hesk_error_buffer[]=$hesklang['enter_ticket_subject'];
$tmpvar['message'] = hesk_input($_POST['message']) or $hesk_error_buffer[]=$hesklang['enter_message'];
$tmpvar['message2'] = hesk_input($_POST['message2']) or $tmpvar['message2'] = '';
I got this from another post ( see the last line in the code ), but it does not work for me. Does this have something to do with my database?
Re: Allowing a field not to be filled in.
Posted: Tue Oct 26, 2010 1:25 pm
by Klemen
Re: Allowing a field not to be filled in.
Posted: Tue Oct 26, 2010 1:34 pm
by Stephan1992
Thank you for the quick reply,
But that does not work.
Still getting the error stating there is some information missing.
Code is now:
Code: Select all
$tmpvar['message2'] = hesk_input($_POST['message2']);
Re: Allowing a field not to be filled in.
Posted: Tue Oct 26, 2010 2:45 pm
by Klemen
But it's not the 'message2' field that is generating it if you have that code...
Re: Allowing a field not to be filled in.
Posted: Tue Oct 26, 2010 2:53 pm
by Stephan1992
It is, because when i do fill a random number/letter in, it does not give me that error.
The field is causing this problem, imo.
Thank you
Re: Allowing a field not to be filled in.
Posted: Tue Oct 26, 2010 4:20 pm
by Klemen
Try changing that code to just
You still get the errors, don't you?
Re: Allowing a field not to be filled in.
Posted: Thu Oct 28, 2010 8:11 am
by Stephan1992
Indeed, i do still get the errors. Can you explain to me what i need to do? Because I think it depends on that field because when i DO fill it in, i dont get the errors.
does it have something to do with:
Code: Select all
else
{
if ($v['req'])
{
$hesk_error_buffer[]=$hesklang['fill_all'].': '.$v['name'];
}
$_POST[$k] = '';
Re: Allowing a field not to be filled in.
Posted: Thu Oct 28, 2010 3:09 pm
by Klemen
I don't know how you modified it so I can't be of much help nor do I officially support third party customizations.
I showed you it's not that field or you have some other code that's checking the same field again, but again supporting such modifications is out of the scope of my support here, sorry.