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:
- Changing the HTML (removing the required status)
- Manipulating the DOM via jQuery / Javascript
- Changing the field from an email field to a regex field and checking if empty
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?