Do you know how to create a form with edit mode? For details: Suppose I've a form with 5 or 6 fields which has button 'Save' and 'Cancel' . If I save the form, it'll show the plain form without text fields and a button named 'Edit' will appear. And When I'll click on 'edit', the form will be editable. Is it possible?
Javascript – Creating form with edit mode
formsjavascript
Related Topic
- Javascript – How to change an element’s class with JavaScript
- Javascript – Setting “checked” for a checkbox with jQuery
- Javascript – Submitting a form on ‘Enter’ with jQuery
- Javascript – Creating multiline strings in JavaScript
- Javascript – Get the current URL with JavaScript
- Javascript – Convert form data to JavaScript object with jQuery
- Javascript – make a
- Html – Clear form fields with jQuery
Best Answer
Full example, can handle as many input fileds as you want.(no select,textarea..)
The code is written based on modern browsers in pure javascript and css3.
Tested on Chrome.
hides and shows the buttons with css3,
saves the default values to apply them on cancel,
responds on the enter button.
If any questions .. just ask
ps: the handler function could be merged into one bigger function... but i think this way it's easier to understand