Change Javascript disallow http://

Discuss everything related to JavaScript Auto Form Validator. Questions and requests here.

Moderator: alexandrleonenko

jqwerty
Newbie
Newbie
Posts: 9
Joined: Jan 8th, '11, 16:31

Change Javascript disallow http://

Postby jqwerty » Feb 15th, '11, 13:38

Hi, is there anyway to change the javascript for TEXT fields to prevent the use of http://?? In other words, I am using JSAFV for form validaton and it works very well. I get quite a few spammers that simply put their URL anywhere there is an open text box. What I'm thinking is in the javascript itself, if I could scan the text fields for http:// at the beginning of the string, if found = error. If not found, continue? Obviously URLs would be something like ruWEBSITE or suWEBSITE, I'm simply interested in the rT or sT types. Does that make sense?

If ru or su, allow http:
If rt or st, don't allow http:

I don't allow the URL on any of the text fields so there would be no reason for them to enter it, unless they are spammers. If I can prevent this, they have no reason to come to the site and spam.

THANKS IN ADVANCE, JON

administrator
Site Admin
Site Admin
Posts: 5997
Joined: Jan 7th, '09, 23:18
Contact:

Re: Change Javascript disallow http://

Postby administrator » Feb 16th, '11, 09:54

What version you work with?

1. We're planning to add new feature in the next version, called "exclude". For example: "exclude"="www, http://, php datagrid, ....." etc.

2. But... you may develop your own type, let say "ru" and define, which characters will be used for it.

Lets see. Text validation is used some arrays, including "this.textchars"

Code: Select all

this.isText = function(parm){
       return this.isValid(parm,this.lwr + this.upr + this.digits3 + this.textchars + diac_lwr + diac_upr);
};


If you remove this array from validation or simply create your own array - you may define new type of text validation, that suit your needs.

jqwerty
Newbie
Newbie
Posts: 9
Joined: Jan 8th, '11, 16:31

Re: Change Javascript disallow http://

Postby jqwerty » Feb 17th, '11, 22:08

version 3.1.7 (12.12.2010)

Yes, that is exactly what I'm looking for, an "exclude" function. When do you think this would be available?

administrator
Site Admin
Site Admin
Posts: 5997
Joined: Jan 7th, '09, 23:18
Contact:

Re: Change Javascript disallow http://

Postby administrator » Feb 20th, '11, 09:04

Hm.. may be in few month.
If you have a basic knowledge in javascript programming, you may easy do it by yourself.


Return to “JS Auto Form Validator”