1

I have a problem with a system called OSTicket. You simply can't remove the "required" status of the input field (email) when you are adding a new user to your database. That's because the dynamic form / input fields are set with Ajax and we can't access those files. Therefore, I have to get a workaround for this. I tried using Javacript / jQuery so that it puts a default value in to the HTML, but that didn't work. With other words: I do not have access to the form that I want to edit, therefore I have to manipulate it on a different way. This is a known issue btw; OSTicket works this way.

Anyhow, in the backend, I can change the validator from email to for example: regex field. So I thought: maybe I can check the field by using a regular expression and checking whether the field is empty... well: no result. If you submit the form, it still gives you the error "field is required, please fill in".

When I check the Ajax response, I see this: http:// mydomainname.com /scp/ajax.php/users/lookup/form

Problem: ajax.php exists, but there is no /users/lookup/form. And when you check ajax.php, it's written like this:

url('^/orgs', patterns('ajax.orgs.php:OrgsAjaxAPI')....

So to wrap it up... I tried:

Now, I think that I have to do something to manipulate the Ajax call (if possible), but I don't know where to start. What is the best way to do this?

I mean, is there a chance I can bypass a required field, without filling in something or is there any other way I can remove the required status of that field after the form has been loaded and I submit the form?

Community
  • 1
  • 1
Siyah
  • 2,852
  • 5
  • 37
  • 63
  • Hard to tell without seeing any relevant code but to submit the form by removing attribute required, you could use in submit handler of `form`: `$('[type=email]').prop('required', false);` – A. Wolff Dec 24 '15 at 10:54
  • The problem is that I can't find the submit handler of this form @A.Wolff. I mean, it all happens in an Ajax file. If I check the response, it gives me this form: ..../scp/ajax.php/users/lookup/form .Well. Ajax.php exists indeed, but there is no /users/lookup/form anywhere in the code so I can't trace it. – Siyah Dec 24 '15 at 11:01
  • Isn't is [open source](https://github.com/osTicket/osTicket-1.8)? So you could download it and do a grep for the action call? – Jan Dec 24 '15 at 12:13

0 Answers0