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




php software development company
By: usha sharma | 08/07/2009Professional Web Development Company phpmaestro provides custom website development web application development ecommerce website design and development services. Custom web application development services and professional website development at affordable rates from phpmaestro Company. www.phpmaestro.com is a php Application Development Shopping Cart for e-commerce stores. Our shopping cart software gives our client full control over your online shop its products design development prices sh
Hire ASP .Net Developers Hire Dedicated ASP.Net Developers Offshore ASP.Net Programmers
By: Arshad | 08/07/2009Since the concept of outsourcing changed the economy of many countries it has been very clear that paying Indian development service providers is very much economical than funding an in-house private team. Analysis says that more than 50% of the cost can be saved by inking contracts with Indian IT service providers.
Windbg Minidump Tutorial:Setting up & Reading Minidump Files
By: Jeannie Lee | 07/07/2009Windgb Minidump tutorial to set up and read minidump files (.dmp). Setting Symbol File Path. Output of Windbg command. windbg.exe -z [file path to minidump file.dmp] -c !analyze -v.
Javascript Validate Name Field
By: Jeannie Lee | 07/07/2009Simple Javascript tutorial on validating a name field. Checks to see if there is a value in the name field with Javascript after the user submits a form.
Logo Design- The image creator!
By: Jhonny Sharma | 07/07/2009Brand image is something that many consumers look for while buying a product. Brand image and brand positioning have become important concepts in the corporate world. When image building strategies are talked about, what tops the list is a creative logo design.
Design principles in logo
By: Jhonny Sharma | 07/07/2009An element of balance is a mandatory aspect of design. A design is considered to be a great design when it incorporates all design aspects in the required proportion. The design principles are vital for any kind of design.
Organization specific software
By: Manish Shrivastava | 07/07/2009Different businesses have different technological needs depending upon the type of work they are engaged in. Some businesses might require minimum use of software technology where there might be others whose very business might depend upon the optimum use of technology.
Hire .Net Developers: Hire ASP.Net Programmers
By: Arshad | 07/07/2009Since the concept of outsourcing changed the economy of many countries it has been very clear that paying Indian development service providers is very much economical than funding an in-house private team. Analysis says that more than 50% of the cost can be saved by inking contracts with Indian IT service providers.
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.
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.
Upload Image Without Refresh Page - Asynchronous Image File Upload Without Ajax
By: Asif Khalyani | 23/06/2008 | ProgrammingI suppose it is neccessary to bring a little bad news to Ajax at this point, it is not possible to process a file upload through the XMLHtrtpRequest Object. The reason of this is that javascript has no access to your computer's file system.