- Professional Skills
- Articles
- Bookmarklets
- Javascript Console For IE
- Neural Net Extension for Ruby
- Writing a PDF Generation Framework In Ruby
- Developing Mambo Components
- PayPal Website Payments Pro
- Bulk File Renaming
- Displaying a Maintenance Page
- Ruby: escape, unescape
- Clojure Tutorial For the Non-Lisp Programmer
- Complex mocking with PHPUnit
- PHP Coding Tips
- Simple CRUD Application
- External Links
- Recent posts
Form Saver
Submitted by moxley on Fri, 2007-06-08 03:35
Auto-fill bookmarket for developers
This bookmarket will save the field values of a form so that it can be automatically filled out with the same values later on, just by visiting the bookmark. The values are saved in a Javascript URL, which can be saved as a bookmark (i.e., bookmarklet).
- Bookmark this link: Auto-Fill Bookmarket Maker
- Go to the page with the form you want to record and fill out the form
- Select the new bookmark.
- A small window will pop up showing the bookmarket source code. Copy the contents starting with "javascript..." to the end of string of text ("()").
- Create a new bookmark and paste the clipboard contents to the bookmark's URL
- Next time the form needs to be filled out, just go to the form and select the form's bookmark
Click here to see the full source.
var code = ""; for(var f=0; f<document.forms.length; f++ ) { if (f>0) code = "<br/>\n"; code = "<b>form " + f + ":</b>\n"; code = "javascript:(function(){f=document.forms[" + f + "];"; var ecount=0; for(var i=0; i<document.forms[f].elements.length; i ) { var e = document.forms[f].elements[i]; if( !e.name ) continue; if( e.type == 'hidden' ) continue; if( e.type == 'submit' ) continue; if( e.type == 'radio' && e.checked ) { code = "f['" e.name "'].checked=true"; } else { var value = e.value; value = value.replace("'", "\\'"); code = "f['" e.name "'].value='" value "'"; } code = "; "; } code = "})()"; } var newwin = window.open("", "codewin", "HEIGHT=250,WIDTH=600,resizable=1"); newwin.document.writeln(code); newwin.document.close(); newwin.focus();


Cape Cod Cottage for Rent