Skip to main content
Participating Frequently
March 4, 2017
Question

Increment number with multiple cursors

  • March 4, 2017
  • 2 replies
  • 1144 views

Does anyone know how to increment number with multiple cursors?

Capture.png

Thanks

This topic has been closed for replies.

2 replies

Participant
May 17, 2017

if you press CMD + Option + arrow you increment number by 10
press CMD + Option + Shift + arrow will increment number by 0.1
can't find a way to increment by 1

Jon Fritz
Community Expert
Community Expert
May 17, 2017

That works to add 10 or .1 to each selected number (changing all 1's to 11's or 1.1's). I believe the OP is looking for a keyboard shortcut style way to change the number on each subsequent selection by 1 higher than the previous, so from...

<label for="option_1">

<label for="option_1">

<label for="option_1">

<label for="option_1">

...to...

<label for="option_1">

<label for="option_2">

<label for="option_3">

<label for="option_4">

...after Ctrl + Selecting with multiple cursors.

Rob Hecker2
Legend
March 4, 2017

I don't know in what way this would need to involve multiple cursors. It looks like you intend to use javascript to process this, since you are putting the unique identifiers in the id, but I would use PHP and create a two level array in the name field. With checkboxes, I don't think you can use the same name for the whole group, the way you would with a radio group, but you can certainly use an array with names like checkbox[0] or even checkbox[<?php echo $value ?>]

A lot depends on whether or not you know how many checkboxes you will need. I often have them coming from a database set of records where I don't know how many there will be.

Processing the group means your post data will contain a separate array for the checkbox set.

You need to provide more info about what exactly you are doing. There are too many different ways this could go to give you a definite answer based on what we know now.

Tomas...Author
Participating Frequently
March 4, 2017

My goal is to increment numbers by 1, don't think about checkbox, imagine regular text in simple html file.