5 ms·
Plugin, plugin, huge word for some code that can be accomplished by this using the plugin: $('form.example input:text').magicpreview('mp_'); without: $('form.
by jrnkntl 18y ago
Plugin, plugin, huge word for some code that can be accomplished by this
using the plugin: $('form.example input:text').magicpreview('mp_');
without: $('form.example input:text').change(function() { $("mp_"+this).html(this.val()); });
or something like that =)
- bdfh42 18y agoTrue, but rather less work when there are a good few form fields. I thought it was worth posting for the idea - building up a finished view alongside data entry. Could have some utility.
- axod 18y agoOr without any library formelement.onchange=function() {previewelement.nodeValue=this.value} True there are caveats, some elements don't fire change until they loose focus... in which case formelement.onkeyup = formelement.onchange etc etc.
- riklomas 18y agoHi, I'm the author of the plug-in, I actually hang around here quite often actually but I didn't realise my plug-in had been submitted until now. The reason I made this plug-in was because I was doing what you were doing in your without-plugin example, but the form got more complex and suddenly the original code wasn't working as well. So I decided to make the plug-in to not only help me out but I figured that other people might be having the same problem too. However, if I was doing something quick and simple, I would do something akin to your without-plugin example.