Reputation: 3330
I have two check boxes one is to send now and the other is to schedule the send and set the date and time. How do i just let one check box option to be selected and make sure the date and time has been selected if the send at check box is selected?
Upvotes: 0
Views: 38
Reputation: 26258
In that case use RADIO
instead of CHECKBOX
and make sure the two RADIO's have the same name so that only can can be selected at any time like:
<input type="radio" value="1" name="scheduler">Send Now
<input type="radio" value="2" name="scheduler">Send At
You can get the selected radio value by:
$('input[name=scheduler]:checked').val();
And put an if
condition like:
if( $('input[name=scheduler]:checked').val() == 1 )
{
// Do some thing here
}
else
{
// Do some thing here
}
Upvotes: 2