How to use JavaScript to detect mobile and hand held devices

If you are maintaining separate web pages on your website for visitors viewing your website on their mobile phones or hand held devies then you can use the following JavaScript code to check the visitor’s user agent and direct them to the relevant web pages. <script type=”text/javascript”> var mobile = function(){ return { detect:function(){ var … Read more

How to use CKEditor in your web page using JavaScript

CKEditor has replaced its older version FCKEditor with more features and enhanced browser compatibility with latest versions of Firefox and Chrome. It’s also more secure than FCKEditor which has been exploited by hackers several times in the past. Use the following JavaScript code to instantiate CKEditor on a web page <script type=”text/javascript” src=””></script> <script type=”text/javascript”>if … Read more

How to implement Lightbox effect in Zencart

Lightbox effect is now the defacto standard for displaying product, category and other images on your website. Javascript popups are a thing of the past and really don’t look that cool. As more and more website content management and e-commerce frameworks provide this feature I will today discuss how we can use this in Zencart. … Read more

How to validate only digits and decimal points in Javascript?

Our company had implemented an online payment form where customers could pay online on the company website against outstanding invoices or any other service. However, the validation on the form regarding the payment amount field was pretty simple as it was just checking whether the customer had input amount in the field or not and … Read more

Disable Enter key on form

If you need to disable JavaScript on your form then apply the following code in the <head> tag. <!– <script language=”javascript” type=”text/javascript”> function checkEnterkey(evt) { var evt = (evt) ? evt : ((event) ? event : null); if (evt.keyCode == 13) { return false; } } document.onkeypress = checkEnterkey; </script> –>

How to use AJAX to check user already exists or not in PHP

AJAX is a wonderful technology that provides the visitor with a “no refresh” experience on the web. With the advent and popularity of Web 2.0 this technology is making progress by leaps and bounds. If you would like to verify whether a user is registered on your website or not then you can use the … Read more