July 15th in Javascript by pbu .

Quick & Easy Form Validation Tutorial with JQuery

Quick & Easy Form Validation with JQuery

Form validation has become never been easy like before. If you havent heard of jQuery, then its time to get know now. Jquery is an open source set of javascript library, that brings user interactivity in web applications so easy even for a beginner with just few lines of code.

In this tutorial, i am going to show how easy to validate a form with jquery. For this you will need to download

JQuery Library …

July 13th in Javascript by pbu .

how to strip special characters with jQuery form validation!

JQuery form validation – How to remove special characters!

i was using a jquery form validation plugin and it was so easy in validating a form. I was stuck in a scenario where i want users to register userID and i dont want them to enter special characters like dots and just want them to enter alphabets, number and underscore in the username.

I went through the documentation of the plugin and there was no such methods to strip the special …

July 12th in Javascript by pbu .

how to reload/refresh a page with jquery?

how to reload/refresh a page with jquery?

Its very simple.

Lets say you have a button refresh all, which basically does reloading the page when you click it. Here is the code

// use location.reload() in jquery to reload a page within onclick
<input name="doRefresh" type="button" id="doRefresh"
value="Refresh All" onClick="location.reload();">

July 12th in Javascript by pbu .

Fix-> JQuery onclick browser jumps to top of page!

JQuery onclick jumps to top of page

i had an issue with jquery code where i have a html link doing specific tasks for onclick event. Since the appear on bottom of my page, when i click on the link the browser jumps to top of the page every time i click.

<a href="#" onclick="dofunct()">click me</a>

This is really very frustrating as everytime i click a link, the browser jumps to top of page. After a long search, i fixed the problem by …

July 12th in Javascript by pbu .

how to call a php script from javascript?

how to call a php script from javascript?

I have always wondered how to call a php script and send GET data from javascript code. It was very important for me as in many projects i have worked i never wanted to header redirect to original php page after delete, edit operations which is really a mess.

jQuery has revolutionized the way we look at javascript and it has certainly bridged the javascript(client side) and php (server side).

so how do you …

July 2nd in Javascript by pbu .

how to check if image loaded or not in javascript?

how to check if image loaded or not in javascript?

If you are having a webpage with large sized images, you would notice the browser taking long time to load those images and showup. A good idea would be show a loading animation until large photos load.

There is a way to check whether the images have been loaded or not in javascript. Using the Image() object is a good method to cache large images.

You can use onload function to trigger a …

July 2nd in Javascript by pbu .

how to change div content in javascript?

how to change div content in javascript?

Its very easy to change the contents of div in javascript. Just get the object of div using getElemementbyID() or getElementbyName() and use innerHTML property with the new value.

divObj = document. getElementbyID("mydiv");
divObj.innerHTML = ‘<p>This is a html code</p>’;

One important thing to note is, your div should have loaded after all the images. If not it wont work.

February 18th in Javascript, PHP Scripts by pbu .

Top Best Web based WYSIWYG html editors (Free)

Best WYSIWYG HTML Editors

I have been searching for some of best web based html editors written in javascript so that i can integrate it with my scripts. I have found pretty nice open source wysiwyg editors so i decided to blog it here.

Please note that some of the editors are just markup editors, which i believe a pretty good alternative to web applications needing lightweight editor. I very much prefer using markup editors keeping simple with just textarea than …

December 24th in Javascript by pbu .

Fix -> Caret/Cursor jumps to start of textarea in javascript

I was working on a javascript bbcode editor (textarea based) and often if the textarea contents are long and automatic scrollbars are enabled. If i replace selected code in textarea using javascript often the cursor jumps to start of the textarea and focus is lost. This problem only happens in firefox and works fine in IE.

This is a very annoying problem and everytime you have to scroll down to insert changes to your textarea content.

Here is you fix it.

Store …

December 18th in Javascript by pbu .

Free Markup TextArea HTML Editor in Javascript

A dead simple, fast loading, light weight and easy to use html markup editor for your projects. It is the ultimate textarea replacement. It does not use iframes instead it just replaces textarea into an editor where you can insert basic html markup codes like bold, italic, hyperlink, image, blockquote and more..

Much of the inspiration of this editor came from the editor used in wordpress forums. I really loved the simplicity of the editor used there. The reason i …

 Page 1 of 2  1  2 »