The plugins site is currently in development.
We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.
setting default values automatically from element attributes
| Project: | Default Value |
| Version: | 1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
I made this defaultvalue script auto-bind to the “defaultvalue” attribute by adding this to the top of my page:
<script type=”text/javascript”>
function defaultvalue_init(s) {
if (s == undefined) s = 'input[default],textbox[default],input[defaultvalue],textbox[defaultvalue]';
$(s).each(function(i) {
$(this).defaultvalue($(this).attr('defaultvalue'));
});
}
$(document).ready(function() {
defaultvalue_init();
});
</script>
with this, you can write code like:
<input type=”text” defaultvalue=”put something here” />
<input type=”text” default=”put something here” />- Login to post comments
