-3

I want to make the url valid if there is something like the first part of the URL.
Example:

  • test.com/images/1.png
  • test.com/images/2.png
  • test.com/images/3.png

How to apply this in my code bellow, as selecting all URLs in once.

var rules = [
  {
    "name": "price1",
    "url": "https://test.com/images)",
    // url : here is when i want to apply the script, like https://test.com/images/%.png
    "fields": [
      {
        "selector": "input[name='data[test]']",
        "value": "6"
      }
    ]
  }
];
Alessio Cantarella
  • 5,077
  • 3
  • 27
  • 34

1 Answers1

0

You can find patterns into the string and then use those patterns.

For example, this string would be replaced by 1, 2, 3... So you should only increment this part as an integer, starting from 1.

To really do it by listing from remote server, you would need to access the imagefolder somehow. In this case, maybe this answer can help you.

If it's locally, you can just iterate through the directory and replace the string as you wish.

Alexander Santos
  • 1,458
  • 11
  • 22