Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Increment number with multiple cursors

New Here ,
Mar 04, 2017 Mar 04, 2017

Copy link to clipboard

Copied

Does anyone know how to increment number with multiple cursors?

Capture.png

Thanks

Views

913
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 04, 2017 Mar 04, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 04, 2017 Mar 04, 2017

Copy link to clipboard

Copied

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

1.JPG

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 04, 2017 Mar 04, 2017

Copy link to clipboard

Copied

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 04, 2017 Mar 04, 2017

Copy link to clipboard

Copied

Interesting. That's a nice feature in sublimetext. There is no similar feature in Dreamweaver (that I know of).

I personally would never use such a feature because I would probably take my list from a database recordset, but I can see how this feature could be useful.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 06, 2017 Mar 06, 2017

Copy link to clipboard

Copied

This can be done when writing the div tags in DW using Emmett.

Typing the following into the code...

div.item_$*5

...and hitting Tab after would give you the same result as the first block of code you want. Typing the following...

ol>li{$. Text}*5

...and hitting Tab would duplicate the second.

Cheat Sheet

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 06, 2017 Mar 06, 2017

Copy link to clipboard

Copied

I need this on elements which is already exists in html, not the new ones...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 06, 2017 Mar 06, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/Jon+Fritz+II  wrote

This can be done when writing the div tags in DW using Emmett.

Typing the following into the code...

div.item_$*5

...and hitting Tab after would give you the same result as the first block of code you want. Typing the following...

ol>li{$. Text}*5

...and hitting Tab would duplicate the second.

Cheat Sheet

Neat, where there's a will there's a way.

Since I mostly now use php based pages I'd just increment the numbers using a variable i++ or you can do it using javascript/jquery.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 17, 2017 May 17, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2017 May 17, 2017

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines