How do I move the content of the old link to the new link? [closed]

For example, in the index.html or .php file there will be a link to the a.html file (). After this link is opened and displayed in a new tab, it will be destroyed and a new random link with the same content will be created instead, that is, the content of a.html will be moved to x(random).html and this will happen in a loop. The href of the element in index.html will also change each time.Is it possible?

Since I couldn’t think of a solution, I asked ChatGPT, but it couldn’t find a solution either.

Download from FTP Folder only modified files to local folder

can you help me with some issue. I need some php or js to download files.
I have FTP and folder on it. In folder will be files (jpg and mp4, but it doesn’t mean). I need to check files there (in folder on ftp) that are “last modified”, and download only modified to local folder (from there start php).
If file is deleted in FTPfolder – delete in local .
If new file add in FTPfolder – download in local
If file was modified(updatet, changed for example date ) – download go local

This php or js will be integrated in some html code

PrimeVue Menubar CSS question – align right but with a dynamically changing button to the left of menu items

I have a requirement where I want to use the PrimeVue Menubar component but modify such that the menu items (links) are aligned to the right of the menu and I need to pass in a button called Versions to be displayed to the left of the first menu link. I need the Versions button to be positioned to just the left of the first menu link regardless of how many or how few menu links there are.

https://stackblitz.com/edit/ri3da8?file=src%2Fcomponents%2FNavBar.vue

The only way I have been able to align the menu links to the right has been through margin-left: auto;. I tried using flex/justify-content end but that doesn’t seem to work in this template.

Setting the menu links margin-left: auto makes it so I am not able to position the Versions button where I want unless I use position absolute which I don’t want to use because it would not be dynamic.

how to solve Uncaught TypeError: Cannot read properties of null (reading ‘addEventListener’) using wordpress multisite

Uncaught Type Error: Cannot read properties of null (reading ‘addEventListener’)
at window.onload ((index):189:50)
at window.onload (scripts.min.js?ver=4.24.2:2:9578)

how to solve this error using multisite wordpress site

if removed media.net plugin in multisite it will be worked otherwise it throws critical error using WordPress multisite

Proper usage of next() in Koa.js Middleware

I use Koa (2.11.0).

I have this very much simplified middleware function, which looks strange after simplification.

However, it is easier to ask the question.
I have two if statements, and I throw three times.
After throwing, I am unsure what would be the best thing to do in all three places:

  1. do nothing, Koa will handle all
  2. add return, while it makes no value adding it, at least some readability to the code.
  3. add return next()
//This is Koa middleware
const tokenProvider: (persons: string[]) => Middleware = (
): Middleware => {
  return async (ctx: Context, next: () => Promise<void>): Promise<void> => {
    const authorizationHeader: string = ctx.headers.authorization

    if (!authorizationHeader) {
      ctx.throw(STATUS_CODES.UNAUTHORIZED)
    }
    try {
      const token: string = authorizationHeader.split(' ').pop()
      if (!token ) {
        ctx.throw(STATUS_CODES.FORBIDDEN)
        // Should I use:
        // - return
        // - return next()
        // - nothing should be used, as Koa will handle it
      }

      return next()
    } catch (error) {
      ctx.throw(STATUS_CODES.UNAUTHORIZED)
    }
  }
}

Want to open camera directly in html5 qr code (reactjs)

I am facing issue on mobile I am not able to open camera directly there is a text name “start scanning” user needs to click that button to open camera and start ,is there any way to open camera directly without click on start scanning button on mobile , I forcefully did it on web using Dom that’s working fine

Want to open camera ditectly without click on text “start scanning”

how to disable unpublish in strapi

i am using strapi 4 and i am creating a custom middleware to prevent unpublish posts. actually i don’t want to let user to unpublish posts.

this is my middleware code

// src/middlewares/prevent-unpublish.ts

module.exports = (config, { strapi }) => {
    return async (context, next) => {
        const isPostRequest = context.request.method === 'POST';
        const isPostsEndpoint = context.request.url.startsWith('/content-manager/collection-types/api::post.post');
      // Check if the request is a POST request and the URL is for the posts endpoint
        
      strapi.log.info('Checking request:', isPostRequest, isPostsEndpoint);
    
      if (isPostRequest && isPostsEndpoint) {
        const data = context.request.body;
        strapi.log.info('Request body:', data);
  
        // Check if the publishedAt field is set to null (indicating an attempt to unpublish)
        if (data && data.publishedAt === null) {
          // Throw an error to prevent unpublishing
          context.throw(403, 'Unpublishing posts is not allowed.');
        }
      }
  
      // Continue with the next middleware
      await next();
    };
  };
  
currently this code not working because i dont have access to request body. how can i fix this problem?

How do I import a CSV file to localstorage Using Vanillia JS

I have to import the data saved in a .csv file and then save this to localstorage.

I previously worked on a script to export date to .csv and now I must do the reverse.

I know I will need to do the following:

  • Get the file
  • Parse the file into a blob
  • Save it to local storage

I have tried the following:

  • Get the file
    <input id="csv" type="file">
    It works!

  • Parse the file into a blob or object I think…
    let csvData = [];
    let csvData = fileInput.addEventListener('change', readFile);
    Does not work! I get a csvData undefined error when I console.log(csvData);.

  • Save it to local storage
    let csvData = [];
    localStorage.setItem("csvData", JSON.stringify(CSV_DATA));
    It works!

Can anyone see what I am doing wrong or mmissing? Perhaps it is the the wrong type of object. I am still learning so I am sorry if it is obvious.

I did search but none of the examples are for vanilla JS.

The code is very disjointed becasue I suck lol, seriously though, I am trying to rebuild the code from an example I found in another question on here. The code I tried to hack was designed to print the output to am HTML element and I need to go to localstorage

This is the entire code:

<body>
  <p>Select local CSV File:</p>
  <input id="csv" type="file">

  <script>
  var fileInput = document.getElementById("csv"),

  readFile = function () {
      var reader = new FileReader();
      reader.onload = function () {
          document.getElementById('out').innerHTML = reader.result;
      };
      // start reading the file. When it is done, calls the onload event defined above.
      reader.readAsBinaryString(fileInput.files[0]);
  };

let csvData = [];
let csvData = fileInput.addEventListener('change', readFile);

let CSV_DATA[];
localStorage.setItem("csvData", JSON.stringify(CSV_DATA));

  </script>
</body>

How to always display Rickshaw’s vertical annotation line?

I added an annotation to my Rickshaw graph. It works as described, but one has to hover over the black dot in the annotation horizontal line below the graph to display the text and click on the text to display the vertical line. Is there any way to always display the text and line? (Yes, I call update() after add(), so that isn’t the problem.)

Leaflet non-geographical map with responsive coodrinates

I am creating a non-geographical map with leaflet, which also has some locations I want to be able to zoom to programmatically. So far that part seems to be working pretty well, but I also want the map to be fully responsive so that the aspect ratio is always equal to that of native image dimensions and the full map is always visible at the initial zoom level. I am attempting to use leaflet’s unproject function to set boundaries and coordinates based on the native image dimensions, but I am getting some strange behavior.

The main issue is that, on load, the map bounces around before eventually centering within the leaflet container and the map starts zoomed out a bit. I would like the map to fill the container on load (zoom: 1) but something about calculating bounds off the native dimensions is throwing that off. I tried setting the bounds based on the container’s dimensions rather than the native image dimensions, but that ends up throwing off the coordinates of the markers.

function pixelTolatlngPosition(pos, map) {
    let LatLng = map.unproject(pos, map.getMaxZoom() - 1);
    return LatLng;
}

function createMap(mapId, imageSrc) {

    function imageReady(map, mapSizer) {
        
        let w = mapSizer.firstElementChild.naturalWidth,
            h = mapSizer.firstElementChild.naturalHeight,
            url = imageSrc,
            southWest = map.unproject([0, h], map.getMaxZoom() - 1),
            northEast = map.unproject([w, 0], map.getMaxZoom() - 1),
            bounds = L.latLngBounds(southWest, northEast),
            imageOverlay = L.imageOverlay(url, bounds); 

        map.setMaxBounds(bounds);
        map.fitBounds(bounds);
        imageOverlay.addTo(map);
        map['imageOverlay'] = imageOverlay;
    
    }

    let map = L.map(mapId, {
        center: [0, 0],
        minZoom: -3,
        maxZoom: 4,
        zoom: 1,
        crs: L.CRS.Simple
    });

    let mapSz = document.getElementById('map-sizer');

    let imgPlano = new Image();
    mapSz.appendChild(imgPlano);
    imgPlano.onload = (() => {
        imageReady(map, mapSz);
    });
    imgPlano.src = imageSrc;

    return map;
}

let markers = [
    {
        'title':'Point A',
        'pos':[1004,1249]
    },
    {
        'title':'Point B',
        'pos':[2232,2440]
    },
    {
        'title':'Point C',
        'pos':[2704,601]
    }
];

let leafletMap = createMap('map', 'https://i.imgur.com/uUP7mqW.jpeg');

document.getElementById('zoom-a').addEventListener('click', function() {
    let pointAPos = pixelTolatlngPosition(markers[0].pos, leafletMap);
    leafletMap.flyTo(pointAPos, 3, {
        animate: true,
        duration: 1
    });
}, false);
img {
    max-width:100%;
}
.container {
    width:550px;
    max-width:100%;
    margin:0 auto;
}
#map-sizer {
    opacity:0;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"></script>
<div class="container">
    <button id="zoom-a">Zoom Point A</button>
    <div id="map"><img id="map-sizer" src="https://i.imgur.com/uUP7mqW.jpeg" /></div>
</div>

I am getting an error with CORS: “Ensure CORS response header values are valid.” [duplicate]

I am new to using the Pledge donations API. I am making an api call when I click a button. However when I make the request, I receive a CORS error, when I look at the networks tab in google chrome debugger. I am not sure why. I am following the api documentation. It says I only need to include the Authorization key and value like this:

# With shell, you can just pass the correct header with each request
curl "https://api.pledge.to/v1/donations" 
  -H "Authorization: Bearer {api_key}"

And that’s what I’ve done:

const endpoint = 'https://api.pledge.to/v1/donations'
const myHeader = {
    'Authorization': `Bearer ${apiKey}`,
}
function handleClick(e){
    e.preventDefault();
     return fetch(endpoint,{
        method:'GET',
        headers: myHeader,
        
    },
    ).then((response)=>{
        console.log(response);
        return response.json();
    }).then((jsonResponse)=>{
        try{
            console.log(jsonResponse);

        }catch(error){
            console.log("there is an error>>>",error);
        }
    });
}

submitBtn.addEventListener('click', handleClick);

But I keep getting this error:

Ensure CORS response header values are valid.

A cross-origin resource sharing (CORS) 
request was blocked because of invalid or 
missing response headers of the request 
or the associated preflight request .

To fix this issue, ensure the response to the CORS request and/or 
the associated preflight request are 
not missing headers and use valid header values.

I also see that the Access-Control-Allow-Origin header has a problem, which says Missing Header.

When i test the endpoint on POSTMAN it works. Perhaps I am missing something in my header? Why am i getting request blocked due to CORS? Any help is appreciated. Thanks!

Flutter WebView Issue with Stripe Checkout: “Stripe.js requires ‘allow-same-origin’ if sandboxed.”

I’m encountering an error while attempting to open Stripe Checkout in a Flutter webview on android, specifically: “Stripe.js requires ‘allow-same-origin’ if sandboxed.” Here’s a breakdown of the situation:

In my Flutter app, I’ve integrated Stripe payments using webview_flutter to enable the Stripe Checkout session since it’s designed for web apps. The checkout page is constructed using HTML and is loaded into a WebView. The HTML contains the necessary Stripe script and styling.

The Flutter code for the checkout page is structured with a stateful widget, including the necessary initialization for the WebView and handling navigation events. However, upon opening the page, it remains stuck on the initial URL and doesn’t proceed to open the Stripe Checkout. Also this problem is happening only in andoid, on iOS everything is fine.
When I run it on android the console displays three distinct issues:

I/chromium( 7353): [INFO:CONSOLE(1)] "Unrecognized feature: 'payment'.", source: https://js.stripe.com/v3/ (1)
"Unrecognized feature: 'payment'."
"Stripe.js requires 'allow-same-origin' if sandboxed."
"Uncaught SecurityError: Failed to read the 'cookie' property from 'Document': Cookies are disabled inside 'data:' URLs."

Despite ensuring the correctness of the session ID, the console errors persist. I’ve attempted to address the problem by setting appropriate headers in the loadRequest method, specifically including ‘Content-Security-Policy’ with ‘sandbox allow-scripts allow-same-origin’. Unfortunately, this hasn’t resolved the issue.

I’ve conducted searches for potential solutions or alternative methods, but no definitive solutions have surfaced.

If anyone has insights into what might be causing these issues or suggestions for resolving them, your assistance would be highly appreciated.

This is the whole code:

  <!DOCTYPE html>
  <html>
    <script src="https://js.stripe.com/v3/"></script>
    <style>
      body, html {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
      }
      #loader {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center; 
      }
    </style>
    <head><title>Stripe checkout</title>
    </head>
    <body>
    
      <div id="loader">
        <span>Please wait...</span>
      </div>
    </body>
  </html>
''';

class CheckoutPage extends StatefulWidget {
  final String sessionId;

  const CheckoutPage({Key? key, required this.sessionId}) : super(key: key);

  @override
  _CheckoutPageState createState() => _CheckoutPageState();
}

class _CheckoutPageState extends State<CheckoutPage> {
  late WebViewController _controller;

  @override
  void initState() {
    super.initState();
    _controller = WebViewController()
      ..clearCache()
      ..setJavaScriptMode(JavaScriptMode.unrestricted)
      ..setNavigationDelegate(
          NavigationDelegate(onNavigationRequest: (NavigationRequest request) {
            if (request.url.startsWith(checkoutSuccessUrl)) {
              context.pop('success');
            } else if (request.url.startsWith(checkoutFailureUrl)) {
              context.pop('cancel');
            }
            return NavigationDecision.navigate;
          }, onPageFinished: (String url) {
            if (url == initialUrl) {
              _redirectToStripe();
            }
          }, onWebResourceError: ( error) {
            print(error);
          },
          ))

      ..loadRequest(
        Uri.parse(initialUrl), headers: {'Content-Security-Policy': 'sandbox allow-scripts allow-same-origin',},
      );
  }
  


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: Container(
        padding: EdgeInsets.only(top: 30),
        child: WebViewWidget(
        controller: _controller,
      ),
      ),
    );
  }

  String get initialUrl =>
      'data:text/html;base64,${base64Encode(Utf8Encoder().convert(stripeHtmlPageScaffold))}';

  void _redirectToStripe() {
    final redirectToCheckoutJs = '''
      var stripe = Stripe('$stripePublicKey');
      var sandbox="allow-same-origin allow-scripts";
      stripe.redirectToCheckout({
        sessionId: '${widget.sessionId}'
      }).then(function (result) {
        result.error.message = 'Error'
      });
    ''';
    _controller.runJavaScript(redirectToCheckoutJs);

  }
}

React-native IAP purchases

Title:
“Error ‘undefined right operand of ‘in’ is not an object’ when implementing in-app purchases in React Native using react-native-iap”

Description:
I’m encountering an issue while trying to implement in-app purchases in my React Native application for Android using the react-native-iap library. The application is configured with different product SKUs, and I’m receiving the error ‘undefined right operand of ‘in’ is not an object’ when attempting to make a purchase.

App Configuration:

“react-native”: “0.73.4”
“react-native-iap”: “^12.12.2”
Emulator: Android Pixel 7 Pro API 27
Additional Details:

The products are active in my Google Play Console.
I have an .aab file activated in my Play Store.

// Importing react-native-iap
import * as RNIap from 'react-native-iap';

// Definition of product SKUs
const itemSkus = Platform.select({
  android: {
    skus: [
      'plan_intermedio',
      'plan_avanzado',
      'plan_exclusiva'
    ]
  }
});

// State hook to store products
const [products, setProducts] = useState([]);

// Side effect to initialize the connection and fetch products
useEffect(() => {
  RNIap.initConnection().catch(() => {
    console.log('error connecting to the store...');
  });
  getProducts();

  return () => {
    RNIap.endConnection(); // Make sure to close the store connection when the component unmounts
  };
}, []);

// Function to fetch products
const getProducts = async () => {
  try {
    if (itemSkus) {
      const products = await RNIap.getProducts(itemSkus);
      setProducts(products);
    }
  } catch (err) {
    console.warn('error', err);
  }
};

// Function to make a purchase
const buyProduct = async (skus) => {
  try {
    const product = skus.productId;
    const purchase = await RNIap.requestPurchase(product, false);
    console.log(purchase);
  } catch (err) {
    console.warn(err.code, err.message);
  }
};

// UI snippet
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
  <TouchableOpacity style={styles.button} onPress={() => buyProduct(showProducts)}>
    <Text style={{ color: '#000', backgroundColor:'#fff', textAlign: 'center' }}>
      Comprar
    </Text>
  </TouchableOpacity>
</View>

Problem:
When attempting to make a purchase using react-native-iap, I receive the error ‘undefined right operand of ‘in’ is not an object.’ I’ve thoroughly reviewed my code, SKU configuration, and attempted various solutions, but the issue persists.

Attempts to Solve:

Reviewed and ensured correct SKU configuration for Android.
Verified proper initialization and closure of the react-native-iap library.
Checked product fetching logic using RNIap.getProducts(itemSkus) for valid product information.
Examined the purchase function (buyProduct) to ensure the correct SKU is passed to RNIap.requestPurchase().
Despite these efforts, I’m still seeking guidance on identifying and resolving the root cause of the error.

Increment a value inside a template literal in JS?

I’m trying to increment a number in a Template Literal in JS, but instead of incrementing the number, it’s printing it. Here’s the code:

Code:

function outputFAQResults(results) {
    
        if(results.faqs) {
            const gridClass = results.faqs.length > 1 ? "grid-2" : "grid-1";
            let count = 1 // Here's the number I want to increment in a map loop

            return `
        <div data-result-type="faqs" class="accordion">
            <h2 class="grid-item-heading gold-line">FAQ's</h2>
            <div class="search-results-section">
                <ul class="${gridClass} found-results list-reset">${results.faqs.map((item) => `
                    <li class="search-result search-result--faq" tabindex="0">
                        <div class="search-result__question"><button data-toggle="collapse" data-target="#faq-${count}" aria-expanded="false" aria-controls="faq-${count}">${item.question}</button></div>
                        <div id="faq-${count}" class="search-result__answer collapse">${item.answer}</div>
                    </li>`${count++}).join("")}
                </ul>
            </div>
        </div>`} else {
            return "";
        }
    }

As you can see, for every map, I’m trying to increase the count variable by one so I can use a Bootstrap Collapse. How can I use the variable without printing it?

Having trouble building multi-step form using the Slick carousel. I am missing something in my JavaScript

I am trying to create a multi-step form using the Slick carousel for a subscription product. The form is supposed to ask what gender, size, items, and then billing. At the end of the form I want to display the choices of the user with a link that links to the product based on the user’s choices.

I found a website that does pretty much what I want – https://www.gruntstyle.com/pages/club-grunt-style

Here is what I have so far – https://codepen.io/Alex-Baker-the-decoder/pen/MWxdKBa

HTML

<body>

  <div id="steps-container" class="container">
    <img src="https://ucarecdn.com/ffcf27ab-90b2-46ac-ae8d-83b11d8ada7c/-/format/auto/-/preview/3000x3000/-/quality/lighter/ClubAdx%20Logo%20w%20box.png" width="500">
    <div id="steps" class="slick-initialized slick-slider">

      <!-- Step slides -->
      <div class="join-club-steps" id="join-step-gender">
        <!-- Step 1 Content: Pick Gender -->
        <h2>Step 1: Pick Gender</h2>
        <label class="gender_male"><input class="hide_radio" type="radio" name="gender" value="male"> Male</label>
        <label class="gender_female"><input class="hide_radio" type="radio" name="gender" value="female"> Female</label>
      </div>
      <div class="join-club-steps" id="join-step-size">
        <!-- Step 2 Content: Pick Size -->
        <h2>Step 2: Pick Size</h2>
        <label class="size_club"><input class="hide_radio" type="radio" name="size" value="s"> S</label>
        <label class="size_club"><input class="hide_radio" type="radio" name="size" value="m"> M</label>
        <label class="size_club"><input class="hide_radio" type="radio" name="size" value="l"> L</label>
        <label class="size_club"><input class="hide_radio" type="radio" name="size" value="xl"> XL</label>
        <label class="size_club"><input class="hide_radio" type="radio" name="size" value="2xl"> 2XL</label>
      </div>

      <div class="join-club-steps" id="join-step-product">
        <!-- Step 3 Content: Pick Product -->
        <h2>Step 3: Pick Product</h2>
        <label class="product_club"><input class="hide_radio" type="radio" name="product" value="SPIKE SHIRT BOX"> SPIKE SHIRT BOX<br><span id="product_detail_club">Receive One Shirt Each Month</span></label>
        <label class="product_club"><input class="hide_radio" type="radio" name="product" value="SPIKE HAT BOX"> SPIKE HAT BOX<br><span id="product_detail_club">Receive One Hat Each Month</span></label>
        <label class="product_club"><input class="hide_radio" type="radio" name="product" value="TROPHY COMBO BOX"> TROPHY COMBO BOX<br><span id="product_detail_club">2 Items - Receive One Shirt AND One Hat Each Month </span></label>
        <label class="product_club"><input class="hide_radio" type="radio" name="product" value="DEAL BOX"> DEAL BOX<br><span id="product_detail_club">Hat OR Shirt from PAST Designs to Save You Money Each Month Alternates Between Shirt and Hat</span></label>
      </div>

      <div class="join-club-steps" id="join-step-billing">
        <!-- Step 4 Content: Pick Billing Frequency -->
        <h2>Step 4: Pick Billing Frequency</h2>
        <label class="billing_club"><input class="hide_radio" type="radio" name="billing" value="1st Month"> 1st Month $1.00<br><span id="product_detail_club">THEN $28 MONTHLY 6 MONTH MIN AGREEMENT</span></label>
        <label class="feq_club"><input class="hide_radio" type="radio" name="billing" value="Monthly"> Monthly<br><span id="feq_detail_club">$28.00 every month, no contract</span></label>
        <label class="feq_club"><input class="hide_radio" type="radio" name="billing" value="3 Months"> 3 Months<br><span id="feq_detail_club">$25.50/SHIRT $75.60 ONE TIME </span></label>
        <label class="feq_club"><input class="hide_radio" type="radio" name="billing" value="6 Months"> 6 Months<br><span id="feq_detail_club">$23.80/SHIRT $142.80 ONE TIME</span></label>
        <label class="feq_club"><input class="hide_radio" type="radio" name="billing" value="12 Months"> 12 Months<br><span id="feq_detail_club">$22.40/SHIRT $268.80 ONE TIME</span></label>
      </div>

      <!-- Final slide to show user selections -->
      <div class="join-club-steps final-slide">
        <h2>Your Selections</h2>
        <p>Gender: <span id="selectedGender"></span></p>
        <p>Size: <span id="selectedSize"></span></p>
        <p>Product: <span id="selectedProduct"></span></p>
        <p>Billing Frequency: <span id="selectedBilling"></span></p>
        <a href="" id="product-link" target="_blank"><button id="join-now-btn">Join Now</button></a>
        <button id="reset-btn">Reset</button>
      </div>
    </div>
    <div id="join-club-progress-bar">
      <ul>
        <li>
          <div class="circle" data-step="1">1</div>
        </li>
        <li>
          <div class="circle" data-step="2">2</div>
        </li>
        <li>
          <div class="circle" data-step="3">3</div>
        </li>
        <li>
          <div class="circle" data-step="4">4</div>
        </li>
      </ul>
    </div>
  </div>
</body>

CSS

/* Center everything */
.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 1500px;
  background-color: #000;
  padding-bottom: 100px;
}

/* Style each step */
.join-club-steps {
  background-color: #fff;
  padding: 20px;
  border: 0px solid #ddd;
  border-radius: 8px;
  background-color: #000;
  margin-bottom: 20px;
  color: #fff;
}

/* Style the progress bar */
#join-club-progress-bar {
  display: flex;
  justify-content: center;
  align-items: center;
}

#join-club-progress-bar ul {
  list-style: none;
  padding: 0;
  display: flex;
}

#join-club-progress-bar ul li {
  margin: 0 10px;
}

.circle {
  width: 40px;
  height: 40px;
  background-color: #ddd;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 20px;
  color: #f1402b;
  cursor: pointer;
}

.active {
  background-color: #f1402b;
  color: #fff;
}
.gender_male {
  font-size: 25px;
  border: solid 2px #fff;
  padding: 25px;
  color: #fff;
}
.gender_male:hover {
  font-size: 25px;
  border: solid 2px #f1402b;
  padding: 25px;
  cursor: none !important;
  background-color: #f1402b;
}
.gender_female {
  font-size: 25px;
  border: solid 2px #fff;
  padding: 25px;
  color: #fff;
}
.gender_female:hover {
  font-size: 25px;
  border: solid 2px #f1402b;
  padding: 25px;
  cursor: none !important;
  background-color: #f1402b;
}
.size_club {
  font-size: 40px;
  border: solid 2px #fff;
  padding: 25px;
  color: #fff;
}
.size_club:hover {
  font-size: 40px;
  border: solid 2px #f1402b;
  padding: 25px;
  cursor: none !important;
  background-color: #f1402b;
}
.product_club {
  font-size: 25px;
  border: solid 2px #fff;
  padding: 25px;
  text-align: center;
  max-width: 280px;
  color: #fff;
}
.product_club:hover {
  font-size: 25px;
  border: solid 2px #f1402b;
  padding: 25px;
  text-align: center;
  max-width: 280px;
  cursor: none !important;
  background-color: #f1402b;
}
.billing_club {
  font-size: 25px;
  border: solid 2px #fff;
  padding: 25px;
  text-align: center;
  max-width: 280px;
  color: #fff;
}
.billing_club:hover {
  font-size: 25px;
  border: solid 2px #f1402b;
  padding: 25px;
  text-align: center;
  max-width: 280px;
  cursor: none !important;
  background-color: #f1402b;
}
#product_detail_club {
  font-size: 14px;
  text-align: center;
  color: #fff;
}
.feq_club {
  font-size: 25px;
  border: solid 2px #fff;
  padding: 25px;
  text-align: center;
  max-width: 280px;
  color: #fff;
}
.feq_club:hover {
  font-size: 25px;
  border: solid 2px #f1402b;
  padding: 25px;
  text-align: center;
  max-width: 280px;
  cursor: none !important;
  background-color: #f1402b;
}
#feq_detail_club {
  font-size: 14px;
  text-align: center;
  color: #fff;
}
.hide_radio {
  display: none;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 25px;
  line-height: inherit;
  background-color: #f1402b;
  color: #fff;
  width: 100%;
  margin-bottom: 10px;
}

JS

$(document).ready(function () {
  // Define products
  const products = [
    {
      gender: "male",
      size: "s",
      product: "SPIKE SHIRT BOX",
      billing: "1st Month",
      productName: "Men’s Small Shirt - Monthly",
      link: ""
    },
    {
      gender: "female",
      size: "2XL",
      product: "shirt",
      billing: "monthly",
      productName: "Women’s 2XL Shirt - Monthly",
      link: ""
    }
  ];

  // Hide all steps except the first one initially
  $(".join-club-steps:not(:first)").hide();

  // When a radio button or select option is changed
  $('input[type="radio"]').on("change", function () {
    var currentStep = $(this).closest(".join-club-steps");
    var nextStep = currentStep.next(".join-club-steps");

    // Show final slide if on the last step and valid
    if (nextStep.length === 0 && isStepValid(currentStep)) {
      showFinalSlide();
    } else {
      navigateSteps(this, "next");
    }
  });

  // Function to check if the step is valid
  function isStepValid(step) {
    var stepId = step.attr("id");
    switch (stepId) {
      case "join-step-gender":
        return $('input[name="gender"]:checked').length > 0;
      case "join-step-size":
        return $('input[name="size"]:checked').length > 0;
      case "join-step-product":
        return $('input[name="product"]:checked').length > 0;
      case "join-step-billing":
        return $('input[name="billing"]:checked').length > 0;
      default:
        return true;
    }
  }

  // Function to display the final slide with user selections
  function showFinalSlide() {
    var selectedGender = $('input[name="gender"]:checked').val();
    var selectedSize = $('input[name="size"]:checked').val();
    var selectedProduct = $('input[name="product"]:checked').val();
    var selectedBilling = $('input[name="billing"]:checked').val();

    // Update final slide with user's selections
    $("#selectedGender").text(selectedGender);
    $("#selectedSize").text(selectedSize);
    $("#selectedProduct").text(selectedProduct);
    $("#selectedBilling").text(selectedBilling);

    // Hide all steps and show final slide
    $(".join-club-steps").hide();
    $(".final-slide").show();
  }

  // Function to navigate steps
  function navigateSteps(element, direction) {
    var currentStep = $(element).closest(".join-club-steps");
    var stepIndex = $(".join-club-steps").index(currentStep) + 1; // Get current step index
    var targetStepIndex = direction === "next" ? stepIndex + 1 : stepIndex - 1;

    if (
      direction === "next" &&
      targetStepIndex <= $(".join-club-steps").length
    ) {
      showStep(targetStepIndex);
    }
  }

  // Function to show a specific step
  function showStep(stepNumber) {
    $(".join-club-steps").hide(); // Hide all steps
    $(".join-club-steps")
      .eq(stepNumber - 1)
      .show(); // Show the target step
    highlightCurrentStep(stepNumber);
  }

  // Function to highlight the current step in the progress bar
  function highlightCurrentStep(stepNumber) {
    $(".circle").removeClass("active"); // Remove active class from all circles
    $(".circle[data-step='" + stepNumber + "']").addClass("active"); // Add active class to the current circle
  }

  // Navigate to a specific step by clicking on the progress bar
  function navigateToStep(stepNumber) {
    showStep(stepNumber);
  }

  // Reset button functionality
  $("#reset-btn").click(function () {
    resetForm();
  });

  // Function to reset the form and go back to the first step
  function resetForm() {
    $('input[type="radio"]').prop("checked", false);
    $("select").val($("select option:first").val());
    showStep(1); // Show the first step
  }

  // Initial setup
  highlightCurrentStep(1); // Highlight step 1
});

Thanks in advance!

I have Verified that the IDs used to update the final slide content (selectedGender, selectedSize, selectedProduct, selectedBilling) match the IDs specified in my HTML.

I have checked the event binding for radio button changes is working correctly and that the change event is being triggered as expected.

The form will get to the Final slide, but will not display the user inputs and link to the product it matches to.