Prevent a text field from having a comma entered [Solved]

Status
Not open for further replies.

PaulT

Member
Is there a way to stop someone entering a comma in a text field such as Fred, B? I tried the special character validation plugin but this didn't work because it ignores commas.
 
Use this code in your form_id.js file
JavaScript:
 var input= jQuery("#table_name___elem_textarea");
     jQuery(input).keydown(function (e) {
        if(e.keyCode == 188){
            e.preventDefault();
        }
     })
 
I placed this code:

var input= jQuery("#geh_clients___client");
jQuery(input).keydown(function (e) {
if(e.keyCode == 188){
e.preventDefault();
}
})

Into /components/com_fabrik/js

I named the file form_7.js

But is didn't stop me from adding a comma into the client field.
Have I done something wrong?
 
The above code actually did work, made a mistake when I entered it. I omitted the # by mistake. Thanks for your help startpoint!
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top