Allowing a field not to be filled in.

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Stephan1992
Posts: 25
Joined: Tue Oct 12, 2010 3:16 pm

Allowing a field not to be filled in.

Post 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
Stephan1992
Posts: 25
Joined: Tue Oct 12, 2010 3:16 pm

Re: Allowing a field not to be filled in.

Post 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?
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Allowing a field not to be filled in.

Post by Klemen »

Try removing

Code: Select all

 or $tmpvar['message2'] = ''
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
Stephan1992
Posts: 25
Joined: Tue Oct 12, 2010 3:16 pm

Re: Allowing a field not to be filled in.

Post 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']); 
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Allowing a field not to be filled in.

Post by Klemen »

But it's not the 'message2' field that is generating it if you have that code...
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
Stephan1992
Posts: 25
Joined: Tue Oct 12, 2010 3:16 pm

Re: Allowing a field not to be filled in.

Post 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
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Allowing a field not to be filled in.

Post by Klemen »

Try changing that code to just

Code: Select all

$tmpvar['message2'] = 'test';
You still get the errors, don't you?
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
Stephan1992
Posts: 25
Joined: Tue Oct 12, 2010 3:16 pm

Re: Allowing a field not to be filled in.

Post 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] = '';
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Allowing a field not to be filled in.

Post 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.
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