You can of course always create your own attributes, say whenever someone modifies the state of your checkbox control you'll set that value to whatever you like, e.g.
$('input#myCheckbox').attr('checked'){
$('input#myCheckbox').attr('myOwnValue', 'This is checked now!');
value of checkbox
right now its just on/off. i would like to set own value. is this possible?
On/off are already interpretations for the checkbox having an attribute 'checked' or not. I found this article quite helpful:
http://jquery-howto.blogspot.com/2008/12/how-to-check-if-checkbox-is-checked.html
You can of course always create your own attributes, say whenever someone modifies the state of your checkbox control you'll set that value to whatever you like, e.g.
$('input#myCheckbox').attr('checked'){
$('input#myCheckbox').attr('myOwnValue', 'This is checked now!');
} else {
$('input#myCheckbox').attr('myOwnValue', 'Nothing checked here!');
}
[code written out of top of my head, will most likely not work as is]
Of course this would invalidate your html, but you can probably live with that if you so want (and need).
Cheers,
Sascha
thank you, although my programmingskills are at "rookie" level.
Regards / Marcus
is working on a reply...