Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

How to make an entire cell clickable

Hi team,

I am trying to script a MBC task in free format where I have lots of separate items that could be selected via checkboxes. One cell looks like this:

<td align=center valign=bottom>  [%ListLabel (ItemList, 1)%]<br><b>€ [%CBCDesignLevelText  (CBC_Random1, 1, 1)%] </b><br> <input id="FFTRandom1_item_1" type="checkbox" value="1" name="FFTRandom1_item_1" onclick="UpdateCost(); NoneCheck;"></td>

Now I want to make the whole cell be clickable but keep the functionality of the defined checkbox.

Problem: if I add class="clickable", the cell becomes clickable, but the checkbox itself is not clickable anymore. I tried lots of other things, i.e. working with
[%CheckSelect(FFTRandom1_item, 1)%]
but then my javascript functions as adding up costs and the like won't work any more.

Is there an easy way to have the whole cell as clickable for my checkboxes?

Thanks a lot,
asked Apr 7, 2017 by Katharina

1 Answer

0 votes
If you want to continue using default HTML checkboxes, you can solve your problem with the use of labels.  Here's a simple example:

<label for="chk">
    <div>Click me or click the checkbox!</div>
    <input type="checkbox" name="chk" id="chk">

If you want to use our graphical checkboxes (calling CheckSelect), you just need to move your JavaScript into SSI_CustomGraphicalCheckbox, a function that runs when a graphical checkbox is changed:

function SSI_CustomGraphicalCheckbox(graphicalObj, inputObj, bln) {
answered Apr 7, 2017 by Zachary Platinum Sawtooth Software, Inc. (69,875 points)