PDA

View Full Version : How to remove the validation for particular field in 'New Ticket' page


rockingcoder
04-19-2010, 12:42 AM
Hi,

When click on 'Open New Ticket' button is osticket home, it redirects a page where in we create a ticket. In 'Open New Ticket' page, we have the below fields,

* Full Name
* Email Address
* Mobile No
* Help Topic
* Subject
* Message
* Captcha Text

Here, I want to change 'Mobile No' field to 'Order Number'. I could change this. But when I enter Alphanumeric text in 'Mobile No' (Order Number), it says 'Valid Phone # is required'. I want to remove the validation for the 'Mobile No' field so that it will accept alphanumberic text.

Can you please help me with this?

Appreciate your help.

Vincent
04-22-2010, 12:50 PM
Tried to change the 'size' of the box?

rockingcoder
04-23-2010, 06:45 AM
Vincent,

I think you have misunderstand my question.

I would like to remove the validation for a field in 'New Ticket' page (i.e) I don't want to the input to be validated for a specific field.

Vincent
04-23-2010, 05:00 PM
Ohh, my apologies.

I'm not aware of that. I'd like to stay of the important files :)

dstearns
04-23-2010, 09:06 PM
Hi,

When click on 'Open New Ticket' button is osticket home, it redirects a page where in we create a ticket. In 'Open New Ticket' page, we have the below fields,

* Full Name
* Email Address
* Mobile No
* Help Topic
* Subject
* Message
* Captcha Text

Here, I want to change 'Mobile No' field to 'Order Number'. I could change this. But when I enter Alphanumeric text in 'Mobile No' (Order Number), it says 'Valid Phone # is required'. I want to remove the validation for the 'Mobile No' field so that it will accept alphanumberic text.

Can you please help me with this?

Appreciate your help.

-Goto your root>>include>>class.validator.php
-open with text editor (notepad)
do a cntrl F for "mobile" or "phone". you are looking for a phrase similar to:
"return(!isnumeric($somevariable) || ... ?false:true"

where $somevariable maybe "$mobile" or "$stripped" or "$phone". You want to delete the "!isnumeric..." all the way to the "||" (including the "||").

You may also need to go to your SQL tables and be sure to set the column that stores "mobile" to a varchar type.

Hope this helps.

Kelli
04-23-2010, 11:31 PM
Or you can change the type of validation applied to the field on lines 1084 and 1179 of class.tickets.php

This might be a better solution, because it leaves the validator function unaltered, should you need to validate phone numbers elsewhere, allows you to change the actual error message, and set whether or not the field is required.