-7

enter image description hereI want to change the below code to select options and execute those functions

<div class="dropdown">
    <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" id="button1">Date Range
    <span class="caret"  id="car"></span><i class="fa fa-calendar"></i>&nbsp;</select>

    <ul class="dropdown-menu">
        <li><input type="checkbox" class="chb" name="checkfield" id="checkboxes"  onchange="today(this)">Today</li>
        <li><input type="checkbox" class="chb" name="checkfield" id="checkboxes"  onchange="lastweek(this)">Last 7 Days</li>
        <li><input type="checkbox" class="chb" name="checkfield" id="checkboxes"  onchange="last30days(this)">Last 30 Days</li>
        <li><input type="checkbox" class="chb" name="checkfield" id="checkboxes"  onchange="presentmonth(this)">This Month</li>
        <li><input type="checkbox" class="chb" name="checkfield" id="checkboxes"  onchange="lastmonth(this)">Last Month</li>
        <li><input type="checkbox" class="chb" name="checkfield" id="checkboxes"  onchange="yesterday(this)">Yesterday</li>
        <li><input type="checkbox" class="chb" name="checkfield" id="checkboxes"  onchange="today(this)">Custom Range</li>
    </ul>
</div>

Change the second image to the first, the code is for the second image

abdul
  • 37
  • 6
  • The code you have shown has a select field _and_ a list of checkboxes already - so unclear what you actually want here. Please make an effort to properly explain what you have, what you need, and what your specific problem is getting there. – misorude Nov 22 '18 at 10:49
  • If i click on an option it should display that – abdul Nov 22 '18 at 10:58
  • What i mean to say is,hyperlink the checkbox as well as labels and when i select ,it should display,i think it should not be a button?? – abdul Nov 22 '18 at 11:00

1 Answers1

0

As i understood your question you need to select only one checkbox ?

If it's that, it's already answered : html select only one checkbox in a group

For action on selected add "onchange" (as you already do, juste custome checkbox follow today() function) and make what you want (don't forget to check the status of the checkbox (selected or not))

Skogandr
  • 133
  • 6