Have an idea?

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

Insert text before and after numeric entry in a grid

I have a grid, column based, set as a constant sum.  I am adding text after the numeric entry box and also need to add text before it.  I know how to do this on a per row basis, but not sure how to write this to apply to all 101 rows that can come up.
This is what I have:
<script>
    $(document).ready(function() {
        $("#Q15_r1_c1").before("$");
    });
</script>
asked Jan 20 by Jay Rutherford Platinum (52,770 points)

1 Answer

0 votes
I realized what I was doing wrong.  I was using dot notation instead of +.  This seems to be working:
<script>
    $(document).ready(function() {
for (var i = 1; i <= 101; i++) {
$("#Q15_r" + i + "_c1").before("$");
}
    });
</script>
answered Jan 20 by Jay Rutherford Platinum (52,770 points)
...