Akismet does a great job in catching comment spam but it is still inserted into the database causing it to bloat over time. So I developed a small WordPress plugin that stops 99% of the comment spam (atleast for me). It uses JavaScript to dynamically add a “hidden” input field to the comments form. A visitor making a comment will also “POST” this value which will be verified before the comment is inserted into the database. No more pesky captchas or asking users to solve dumb calculations.Continue Reading…
Disable Javascript in Firefox 23
The latest Firefox version 23 has been released and it is on news for a lot of reasons.
A new logo, lack of support for the <blink>
tag, blocking of mixed (HTTP content on a HTTPS page) to name a few. Among these is “the inability to disable javascript” an article said. What?
Then how do I disable javascript in Firefox 23 to test my new blog design sans JS?
Earlier it was just a matter of Tools menu > Options > Content tab and uncheck “Enable Javascript” to disable javascript.Continue Reading…
Username availability check with AJAX and PHP
Recently the AJAX bug bit me and I started rewriting the code of htdigest generator, htpasswd generator and URL encoder/decoder after learning some basics from w3schools.com. I tried creating a username availability validator using AJAX and it worked well so I am here writing this article on how to do this. I will be concentrating more on the AJAX part and less on PHP because I have already written an article on how to connect PHP and MySQL. In the end of this article there is a link to a demo which I created, it has a HTML form sans form tags 😛 just to demonstrate username validation.Continue Reading…
Javascript Validation with Regular Expressions
After reading this article you’ll be able to do advanced javascript validation using regular expressions a.k.a. RegExp for basic javascript validation read Javascript Validation – Textbox Combobox Radiobutton Checkbox. Using regular expressions the entered content can be validated with advanced conditions like the string entered shouldn’t contain spaces, special characters, numbers, uppercase or lowercase etc. Once you learn the art of using regular expressions you can use it with many computer languages.Continue Reading…
Javascript Validation – Textbox Combobox Radiobutton Checkbox
Validate your HTML form with Javascript validation. The tutorial describes Javascript validation of textboxes, comboboxes, radio buttons and checkboxes. In Javascript we create a function which checks if some value is entered in the textbox or selected in the case of combobox, radiobutton, checkbox. If a textbox is empty or an option is not selected we can use javascript to display an alert message, and highlight the empty field and also we should make sure the page stays the same and doesn’t get “submitted”Continue Reading…
Javascript Reload Image
Using Javascript you can reload an image without reloading the page. This is extremely useful for reloading a captcha image if the user is unable to read the characters shown in it. Reloading an image using Javascript is just a simple matter of reassigning the same image location to the image src attribute. But the problem is the browser doesn’t call the image from the web server, since the name is same the browser just fetches the same image from the cache (Temporary Internet Files). So to overcome this we must add something with the image src attribute in such a way that it doesn’t affect the image location. The best way to do it is to add it like a query string to the image.Continue Reading…