I am Asif Khalyani. I am software Engineer. PHP and ajax free script download site phpasks. Ajax Edit in Place Text.
As everybody knows, refreshing pages is so 1999. AJAX, DOM, whatever you call it makes it possible to let people edit a piece of text inline without having to use a submit button.
You say: but that ain’t new at all! I say: But all of this has been made easy to use and implement: 2.0!
Example page: inline edit (no JS knowledge needed) [source ] | Inline example: Please edit me!
how you can make it work (5 easy steps for integration)
* Download this Javascript file: InstantEdit 2.0 JS
* Create a update file that handles the input. For example this PHP: Update File
* In your page add the javascript:
* Set fixed vars (like hidden elements in a field post). These will be posted with the editable field so you can identify a user/session.
setVarsForm("pageID=profileEdit&userID=11");
* Last step: in your HTML for any editable field add a SPAN arround it:
John Doe
Note: id is the fieldname (?userName=John Doe&), and should be unique!
You’re done! Tell you friends… smile
how it works
A small piece of javascript reads al SPAN tags, checks if it has class="editText" and a id=. If that is true, it adds a onclick function. That onclick function will create a textfield or input (depending on the size of the editable text). Someone has the ability to edit the field. When the text field is blurred, it will read the contents, and starts a XMLHttpRequest and ‘sends’ the content + fieldname + any set vars to an update file. That file will update your database, and reply with the newly set text and the textfield will dissapear again.
IE? FF?
This script works in internet explorer, netscape and firefox. Any other platforms haven’t been tested. That’s kinda up to you.
- Related Videos
- Related Articles
- Ask / Related Q&A
- Ajax Tutorial- Loads of Information Available Online
- Save time with ScriptArtist PHP and AJAX code generator!
- Upload Image Without Refresh Page - Asynchronous Image File Upload Without Ajax
- Ajax Form Validation and Thread-safe Ajax
- Ajax Rating Script - Php & Mysql
- Alternative to Ajax
- Php Frameworks
- Introduction to Ajax




Getting the Best in Ecommerce Website Development
By: Arun Kumar | 28/12/2009To run an ecommerce site, one needs to get the site developed at the professional hands of an expert ecommerce web site developer. The developer would try to understand the exact business requirement of the client by discussing in detail about his/her business goal and target audience.
iPhone Applications Development: When the Best of Additional Applications Reverberate You
By: Arun Kumar | 28/12/2009It all started with the launch of the revolutionary iPhone from the Apple stable. iPhone mobile application development is now one of the most advanced software program development areas where much of research has been poured onto.
Magento Development
By: Digisha Modi | 26/12/2009Magento eCommerce Development is an incredibly advanced suite which enables you to have a shopping cart up and running in a very short time. Magento includes advanced reporting and analysis features which will increase your awareness of sales trends and other customer activity to enable you to tune your business for maximum efficiency. Its unique characteristics are unlimited flexibility, completely scalable architecture, professional and community support and smooth integration with 3rd party a
PSD to XHTML Conversion Services
By: Digisha Modi | 26/12/2009To make a website easily visible and popular, making it browser compatible is very important. For this PSD to XHTML conversion is one of the most vital elements of Web designing. Its growing importance in the designing cannot be completely annulled. With the increasing competition among the web marketers, the importance of a good design with better usability has become the necessity of the present time.
Magento Extension Development
By: Digisha Modi | 26/12/2009Magento is a feature-rich, professional open-source eCommerce solution that offers merchants complete flexibility and control over the look, content, and functionality of their online store. Magneto’s intuitive administration interface contains powerful marketing, search engine optimization and catalog-management tools to give merchants the power to create sites that are tailored to their unique business needs.
How to burn WMV video to DVD to enjoy on TV, xobx, PS 3 or other playwers
By: lyndon123 | 26/12/2009WMV video is a one of the most pop format video we often use. Enjoy the WMV video on TV, Xbox, PS 3 or other DVD Players is often necessary in our common life. Now we can follow this simple guide to learn how to burn WMV to DVD Disc.
Mobile antivirus software is beginning to be an essential
By: brookepens | 25/12/2009When it comes to our home computers and networks in the work place everyone ensures that they are protected by mobile antivirus software with protective firewalls. Unfortunately, there are still many people and businesses that do not realise that mobile phone antivirus software has become just as important to have as antivirus computer software.
NetOffice Customization
By: Digisha Modi | 25/12/2009NetOffice is a web based project management tools written in PHP and utilizing MySQL. It has a surprisingly easy to use user interface, and it really is self explanatory, even for first time users. It has the same features as most other free web based project management tools but is set apart from the pack by its simple layout and amazing ease of use.
Easy Ajax Inline Text Edit 2.0
By: Asif Khalyani | 09/09/2008 | ProgrammingA small piece of javascript reads al SPAN tags, checks if it has class="editText" and a id=. If that is true, it adds a onclick function. That onclick function will create a textfield or input (depending on the size of the editable text). Someone has the ability to edit the field. When the text field is blurred, it will read the contents, and starts a XMLHttpRequest and ‘sends’ the content + fieldname + any set vars to an update file.
Ajax Rating Script - Php & Mysql
By: Asif Khalyani | 09/09/2008 | ProgrammingFrequent visitors of ajax enabled websites, like ajaxian, have all witnessed them already: ajax rating widgets.
Crop Image File Size, Width & Height Using Php Script
By: Asif Khalyani | 03/07/2008 | ProgrammingCropping and resizing your images for the Web is a common technique for creating smaller thumbnail images that download quickly.
Ajax Form Validation and Thread-safe Ajax
By: Asif Khalyani | 03/07/2008 | ProgrammingThis is the PHP and AJAX form validation application you can create AJAX and PHP: Building Responsive Web Applications.