Hello All:
I am using a div to simulate a checkbox effect; thus, with each click of the div, my jquery displays a different option (in my case: whether the user wants to select a Monthly or Yearly Subscription).
The Jquery code:
$(document.body).ready(function () {
$(function () {
var main_obj_id = 'on_off';
var on_class = 'on_off_on';// means Monthly
var off_class = 'on_off_off'; //means Yearly
$('#' + main_obj_id).click(function () {
if ($(this).is('.' + on_class)) {
$(this).removeClass(on_class);
$(this).addClass(off_class);
$(this).html('Monthly');
} else {
$(this).removeClass(off_class);
$(this).addClass(on_class);
$(this).html('Yearly');
}
});
});
});
The Html:
<div id="on_off" class="on_off_on" style="cursor:pointer" >Yearly</div>
Again, on the html, with each click of the div, the value toogles between Monthly and Yearly.
Now, my question: how can I post during my form submission the value of the selection (Monthly -defined in js as: var on_class = 'on_off_on'; and Yearly --defined in JS as: var off_class = 'on_off_off';) ?
Any thoughts on this appreciated!
Mossa