React Calender selects previous dates

I am trying to use React Calender package for my Next.js application for date picking. The problem that I have is that starting from the Month of October, from day 10th, each time I select a date, the previous date gets selected.
For instance, if I select 11th, it gets to display 10th as selected and when I console.log() it shows that it selected 10th.
This continues until December and from January, every date selected reflects properly.
I attached an image screen shot. I actually selected day 16 but it was day 15 that got selected and shown instead of day 16 that I clicked. When I console.log the output I found this:

Wed Oct 15 2025 17:00:00 GMT-0700 (Pacific Daylight Time)

How do I resolve this?
enter image description here

How to enable use of the forward button in my vanilla typescript single page app (code examples included)

I am building a single page application using vanilla typescript and golang. I am having trouble managing my history properly.

To be clear, here is how the application functions on initial page load.

  1. You make a request to the go http server.
  2. You get back a blank HTML template with a script tag at the bottom.
  3. The browser makes a request to the server for the .js bundle.
  4. Javascript bundle is retrieved and then takes the browser’s window.location.pathname and runs an associated handler function
  5. The handler executes middleware.
  6. The handler renders the view.
  7. Request complete.

From here, the client-side javascript handles routing through different views via a redirect function.

Fun, now we get into some code.

Here is the global session I use to track the users history and potential state values. It also contains the apps router.

export type Session = {
    Router: Map<string, () => void>,
    History: string[],
    State: Map<string, any>,
}

export let session = {
    Router: new Map<string, () => void>(),
    History: new Array<string>(),
    State: new Map<string, any>(),
}

Routes are simply registered in the apps root-level index.ts

import { enableHistory, preventForwardNavigation } from "./client/events"
import { session } from "./client/global"
import { handlerHome, handlerLogin } from "./client/handlers"

enableHistory()
preventForwardNavigation()

session.Router.set("/", handlerHome)
session.Router.set("/login", handlerLogin)

let handler = session.Router.get(window.location.pathname)
if (handler) {
    handler()
} else {
    console.log("404")
}

Let’s take a closer look at the enableHistory() and preventForwardNavigation() functions.

export const enableHistory = () => {
    window.addEventListener('popstate', (e: PopStateEvent) => {
        let previousURL = session.History[session.History.length - 2]
        session.History = session.History.slice(0, session.History.length - 2)
        if (previousURL) {
            let handler = session.Router.get(previousURL)
            if (handler) {
                window.history.pushState({}, "", previousURL)
                handler()
            }
        } else {
            history.back()
        }
    })
}

export const preventForwardNavigation = () => {
    if (window.history && window.history.forward) {
        window.history.forward = function() {
            alert("Forward navigation is disabled.");
        };
    }   
}

Okay, so as an overview, the enableHistory() grabs the next to last element off the session.History stack (which represents the previous path loaded) and then calls the appropriate handler function found in session.Router.

Lets take a look at a handler and then a view so we can see what it looks like when history is pushed onto session.History

Here is a handler which is called when a user hits “/”:

export const handlerHome = () => {
    document.title = "CFA Suite - Home"
    mwRunner([mwInit, () => {
        render(ViewHome())
    }, mwTele, mwLinks, mwLog])
}

The handler calls middleware and then makes a call to ViewHome() which ultimately generates the HTML the user sees and interacts with.

Okay, now we are closing in on the problem. Lets take a look at mwLinks, which is a middleware which modifies the way links function in the application.

export const mwLinks = (): void => {
    let links = document.querySelectorAll('a')
    links.forEach(link => {
        link.addEventListener('click', (e: Event) => {
            e.preventDefault()
            let href = link.getAttribute('href')
            if (href) {
                redirect(href)
            }
        })
    })
}

As you can see, all links in the application make a call to redirect() when they are clicked. Here the function redirect:

export function redirect(fullPath: string) {
    window.history.pushState({}, "", fullPath)
    let handler = session.Router.get(getBasePath(fullPath))
    if (handler) {
        handler()
    } else {
        console.log("404")
    }
}

Okay, so as you can see, history is really managed 3 places in the application. On initial page load, we make calls to enableHistory() and preventForwardNavigation() and then when a link is clicked, we make called to redirect() which pushes state to window.history and pushes a path on session.History.

So to be clear, history in the app works. But I have two problems:

  1. The forward button does not work properly. That is why I disabled it. And I am not 100% sure why it doesn’t work properly.

  2. When I right click my back button (like the actual back button in the browser) I notice my history stack continues to grow after clicking the back button.

How can I resolve this problem and make my forward button work properly while having an accurate history stack within the actual browser history stack (not session.History).

I have tried extensively to solve this problem and has been the hardest issue in my entire project.

Thank you so much for your time, I appreciate you!

Why do my videos not work on some devices?

For some devices my videos don’t play and have also controls which i don’t want them to be.

 <video id="videoBackground"  autoplay="autoplay" muted loop> 
        <source src="/assets/videos/STG_vSnap (1).mp4" type="video/mp4">
    </video>



 <video src="/assets/videos/copy_4D5E883B-1457-44F9-AE36-86C72CF3657A.mp4" autoplay muted loop  id="videoMediaMaestri" class="reveal"></video>

these are the two videos codes.

But also i had a problem with the fact that i have unnecessary space in the pages, i tried to put overflow hidden but it would block the whole website.

This is the link of the website www.mediamaestri.com , let me know if there is something wrong and where i make mistakes.

Thank you in advance

Creating an Apply Now Page and keep getting this error when trying to submit sample applications on React JS

I have a problem with website project. I am trying to create an apply now page so that people can apply on my website. I am trying to connect the front end to the back end and keep getting this error message: Failed to load resource: the server responded with a status of 404 (Not Found)
My project consists of a folder structure like this:

- tbs-website
 - client
  - node_modules
  - public
  - src
   - css
    - apply.css
    - FileInput.css
    - home.css
   - js
    - FileInput.jsx
    - submitApplication.jsx
   - pages
    - applynow.jsx
    - home.jsx
    - index.jsx
    - trafficcontrol.jsx
   - App.jsx
   - main.jsx
  - package.json
  - package-lock.json
  - vite.config.js 
 - server
  - node_modules 
  - src
   - server.js
  - package.json
  - package-lock.json

My Apply Now page (applynow.jsx)

// applynow.jsx
import React from 'react';
import '../css/apply.css'
import FileInput from '../js/FileInput';
import { sendFormDataToServer } from '../js/submitApplication'
import { Link } from 'react-router-dom'
const Apply = () => {

  const handleSubmit = async (e) => {
    e.preventDefault();

    // Collect form data
    const formData = {
      email1: '[email protected]',
      email2: '[email protected]',
      email3: '[email protected]'
    };

    // Send form data to server
    const result = await sendFormDataToServer(formData);
    console.log(result); // Log the result
  };
    return (
      <html>
        <head>
          <meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
          <link rel="stylesheet" href="/index.css"/>
        </head>
        <body>
          
            <header class="header">
      <a href="#">
        <img class="logo" alt="TBS logo" src="tbs logo.png" />
      </a>

      <nav class="main-nav">
        <Link to="/applynow">Apply Now</Link>
        <ul class="main-nav-list">
          <li><a class="main-nav-link" href="http://www.msn.com">Traffic Control</a></li>
          <li><a class="main-nav-link" href="#how">Clothing and Bags</a></li>
          <li>
            <a class="main-nav-link" href="#how">Banners and Posters</a>
          </li>
          <li><a class="main-nav-link" href="#how">Business Cards</a></li>
          <li><a class="main-nav-link" href="#how">Window Vinyls</a></li>
          <li><a class="main-nav-link" href="#meals">Items</a></li>
          <li>
            <a class="main-nav-link" href="#testimonials">Signs</a>
          </li>
          <li><a class="main-nav-link" href="#pricing">Pricing</a></li>
          <li>
            <a class="main-nav-link nav-cta" href="#cta">Get a free quote</a>
          </li>
        </ul>
      </nav>

      <button class="btn-mobile-nav">
        <ion-icon class="icon-mobile-nav" name="menu-outline"></ion-icon>
        <ion-icon class="icon-mobile-nav" name="close-outline"></ion-icon>
      </button>
    </header>
        
        <main>
        <div class="apply-container">
          <h1 class="apply-now">APPLY NOW</h1>
          <h2 class="descript">Discover a career with TBS, 
          a premier leader in traffic control solutions! 
          As a dynamic and rapidly growing company in the traffic management industry, 
          TBS takes pride in revolutionizing how we navigate and manage traffic flow. 
          Join our dedicated team and contribute to creating safer, 
          more efficient roadways.</h2>
        </div>
        <form class="apply-set -- box" id="applicationForm" onSubmit={handleSubmit}>
          <div class="container container--narrow page-section">

          <h1 class="job-app-box">Job Application Form</h1>
          <h2 class="job-fill">Please Fill Out the Form Below to Submit Your Job Application!</h2>
            
            
          <label class="name">Name: </label>
        <div class="first-input">
        
          <div class="first-name">
              <div class="name-input">
                <label class="first-label-name">First Name *</label>
                  <input class="first-name-input"text="first-name--input" placeholder="Enter First Name"></input>
              </div>
              </div>
            <div class="last-name">
              <div class="name-input"> 
            <label class="last-label-name">Last Name *</label>
              <input class="last-name-input"text="last-name--input" placeholder="Enter Last Name"></input>
              </div>
            </div>
            </div>
            <label class="emailphone-label">Email/Phone Number:</label>
            
            <div class="emailphone-input">
            
            <div class="email">
            <div class="name-input">
            <label class="email-name">Email *</label>
              <input class="email-box"text="email--input" placeholder="Enter Email"></input>
              </div> 
              </div>
              
            <div class="phone">
            <div class="name-input">
            <label class="phone">Phone Number *</label>
              <input class="phone-box"text="phone--input" placeholder="Enter Phone Number"></input>
              </div>
              </div>  
              </div>  

            <label class="resume-label">Resume/Cover Letter:</label>
              <h1 class="resume-note">Note: You can only submit .doc, .pdf, .txt, and .pages files</h1>
            <div class="resume-input">
              <div class="resume">
              <div class="name-input">
                <label class="resume-name">Resume *</label>
                <FileInput></FileInput>
                </div>
                </div>   

                <div class="cover-letter">
              <div class="name-input">
                <label class="cover-name">Cover Letter</label>
                <FileInput></FileInput>
                </div>
                </div>    
            </div>
            <label class="message-label">Message: </label>
            <h1 class="message-note">Tell us why you want to work for TBS! </h1>
   
                <textarea class="message-text"
                          name="message"

                          placeholder="Enter Message"></textarea>
<button type="submit" class="btn btn--full submit-app">
            Submit Application
          </button>

          </div>



         </form>
         <footer class="footer">
                  <div class="site-footer__inner container container--narrow">

                        <h1 class="tbs-copy">
                          <a href="index.html">&copy; 2023 Traffic & Barrier Solutions, LLC</a>
                        </h1>
                        <h1 class="footer-number">706-263-0175</h1>
                      </div>

            </footer>
        </main>
        </body>
        </html>
    )

    }
export default Apply;

All of my css has been successfully exported from apply.css to the back-end and that was part of the problem. However, my next problem is that I am getting the error when I submit a dummy application to my gmails. I have two JavaScript files that connect to the applynow.jsx. However, I don’t know if I need to include the App.jsx and the main.jsx files in the client folder. Here is my submitApplication.jsx file:

// submitApplication.jsx
export async function sendFormDataToServer(formData) {
    try {
        const response = await fetch('http://localhost:5173/submit-gmail-addresses', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(formData),
        });

        if (response.ok) {
            // Handle success
            return 'Success: Form data submitted to server';
        } else {
            // Handle failure
            return 'Error: Failed to submit form data to server';
        }
    } catch (error) {
        // Handle network error
        console.error('Network error:', error);
        return 'Error: Network error';
    }
}

And here is the server.js from the server/src folder:

// server.js
const express = require('express');
const bodyParser = require('body-parser');
const nodemailer = require('nodemailer');
const path = require('path')
const app = express();
const port = 5173;

// Middleware to parse JSON bodies
app.use(bodyParser.json());

// Endpoint to handle form submission

app.use(express.static(path.join(__dirname, 'client')));

app.post('/submit-gmail-addresses', async (req, res) => {
    const formData = req.body;

    // Process the form data
    console.log('Received form data:', formData);

    try {
        // Send application to specified Gmail addresses
        const result = await sendApplication(formData);

        // Send success response
        res.status(200).json({ success: true, message: 'Application sent successfully' });
    } catch (error) {
        console.error('Error sending application:', error);
        // Send error response
        res.status(500).json({ success: false, error: 'Failed to send application' });
    }
});

app.get('/', (res) => {
    // Send response for '/applynow' route
    res.sendFile(path.resolve)
    res.send('This is the home page');
});
// Endpoint to handle requests to '/applynow'
app.get('/applynow', (res) => {
    // Send response for '/applynow' route
    res.sendFile(path.resolve)
    res.send('This is the apply now page');
});

// Function to send application
async function sendApplication(formData) {
    // Configure Nodemailer transporter
    const transporter = nodemailer.createTransport({
        // Configure transporter options (e.g., SMTP settings)
    });

    // Construct email message
    const mailOptions = {
        from: '[email protected]', // Sender's email address
        to: [formData.email1, formData.email2, formData.email3], // Array of recipient email addresses
        subject: 'New Job Application',
        text: `nName: ${formData.firstName} ${formData.lastName}nEmail: ${formData.email}nPhone: ${formData.phone}nResume: ${formData.resumeFile}nCover Letter: ${formData.coverLetterFile}nMessage: ${formData.message}`,
    };

    // Send email
    await transporter.sendMail(mailOptions);
}

// Start the server
app.listen(port, () => {
    console.log(`Server is listening at http://localhost:${port}`);
});

So I want it to send all job applications to all three of these Gmails but unfortunately, it displays the error message in the “Inspect”. Whenever I try to start my application up on the terminal through C:UsersrowelOneDriveDesktopTBSwebtbs-websiteserversrc> node server.js, it displays Server is listening at http://localhost:5173, however, when I submit everything on the apply now page, it won’t work. If I need to explain more about my lines of code here or add more files of code, feel free ask more questions so I can add more code to this forum. Otherwise, I need help to get my VITE/REACT to submit applications from the client’s end to the server’s end, then server’s end sends emails of the submitted application to the emails listed.

Accessing session information from another tab and site

I have inherited maintenance of a PHP website that is mysite.com and an ASP.NET website that is shop.mysite.com. The client wants a single sign-on for both sites. The solution I am pursuing is to create a function on the ASP.NET site that returns the necessary information to the PHP site.

The ASP.NET function is called “IsUserLoggedIn” that returns a JSON object with the username and an array of roles.

Here is a condensed version of that function:

        [HttpGet]
        [AllowAnonymous]
        public async Task<IActionResult> IsUserLoggedIn()
        {
            try
            {
                    if (HttpContext.Request.Headers["api-key"][0] != configuration["ApiKey"])
                    {
                        HttpContext.Response.StatusCode = 200;
                        return Json(new { authenticated = "no key", roleId = "" });
                    }

                    if (HttpContext.User.Identity.IsAuthenticated)
                    {
                        var user = await userOperations.GetUser.Execute(HttpContext.User);
                        var companyUser = await companyRepository.GetUser(user.Id, user.ActiveCompanyId);

                        var roles = new List<String>();
                        if (companyUser.Company.CustomerRoles != null)
                        {
                            roles.AddRange(companyUser.Company.CustomerRoles);
                        }

                        if (companyUser.UserCompanies != null)
                        {
                            foreach (var company in companyUser.UserCompanies)
                            {
                                if (company.CustomerRoles != null)
                                {
                                    roles.AddRange(company.CustomerRoles);
                                }
                            }
                        }

                        HttpContext.Response.StatusCode = 200;
                        return Json(new { authenticated = "yes", User = user, roleId = roles });
                    }
                    else
                    {
                        HttpContext.Response.StatusCode = 200;
                        return Json(new { authenticated = "not auth", roleId = "" });
                    }
            }
            catch (AuthenticationException e)
            {
                HttpContext.Response.StatusCode = 200;
                return Json(new { authenticated = "error", roleId = "", e });
            }
        }

When I am logged into shop.mysite.com and open another tab and go to shop.mysite.com/User/IsUserLoggedIn (with the api-key in the request header), it returns a JSON object as expected:

{
  "authenticated": "yes",
  "user": {
    "id": 17085,
    "username": "cdavis",
    "verified": true,
    "activeCompanyId": "TEST001"
  },
  "roleId": [
    "NGFE"
  ]
}

However, when I try to get the data using fetch in JavaScript, it returns a JSON object showing there is no user authorized. Here is my JavaScript code running in mysite.com:

    async function checkUserLoggedIn() {
        try {
            const response = await fetch('https://' + custom_script_vars.api_url + '/User/IsUserLoggedIn', {
                method: 'GET',
                headers: {
                    'api-key': custom_script_vars.api_key,
                },
                credentials: 'include',
            });
            
            console.log('Response status:', response.status);

            if (response.ok) {
                const jsonData = await response.json();
                console.log('User logged in:', jsonData);

                const phpEndpoint = custom_script_vars.theme_directory + '/set-session.php';

                // Use AJAX or another fetch to pass the JSON data to your PHP method
                await fetch(phpEndpoint, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json',
                    },
                    body: JSON.stringify({ companyResourcesSessionUserLoggedIn: jsonData }),
                });
                console.log('User logged in:', jsonData);
            } else {
                console.error('Failed to check user login status:', response.status);
            }
        } catch (error) {
            console.error('Error during user login check:', error);
        }
    }

The JSON object returned by the JavaScript fetch:

{
  "authenticated": "not auth",
  "roleId": ""
}

Am I just trying to do something that is not allowed? I have tried it in both Chrome and Edge with the same behavior in each.

I assume that fetch in JavaScript is not just like “opening a tab in the background”. I’d love any alternatives if you have done something similar.

React Router Dom conditionally rendering an element

I am setting up a new project and using the latest version of react-router-dom. Their documentation suggests using createBrowserRouter which I am working on implementing.

What I want to achieve is rendering a different header depending on the path params.

Currently I am using an optional path param:

const router = createBrowserRouter([
  {
    path: '/:appTypeId?',
    element: <ReferralDetails status="new" />,
  },
])

Now, if an appTypeId is provided I want to render my <Header /> component above my <ReferralDetails /> component.

Something like:

<>
  <Header />
  <ReferralDetails />
</>

Any ideas how I can accomplish this?

How do I increase the index number of I

I took this code sample from w3schools https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_dom_html_callback

I want to increase the index number of I how do I do this without showing zero on both the .text and .html code blocks

    <!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#btn1").click(function(){
    $("#test1").text(function(i, origText){
      return "Old text: " + origText + " New text: Hello world! (index: " + i + ")"; 
    });
  });

  $("#btn2").click(function(){
    $("#test2").html(function(i, origText){
      return "Old html: " + origText + " New html: Hello <b>world!</b> (index: " + i + ")"; 
    });
  });
});
</script>
</head>
<body>

<p id="test1">This is a <b>bold</b> paragraph.</p>
<p id="test2">This is another <b>bold</b> paragraph.</p>

<button id="btn1">Show Old/New Text</button>
<button id="btn2">Show Old/New HTML</button>

</body>
</html>

node js rimraf delete dist folder in any of the subfolders of src

I have many dist folders inside src folder. It can be nested at any depth.

src
    - main
        - dist
        - com
            - dist
            ....
    - test
        - dist
        - com
            - dist

I need a command in rimraf to delete all such dist folders inside src folder.

I tried rimraf src/**/dist, src/*/dist, src/**/*/dist, but none of them are working, in fact I am getting an error saying Error: Illegal characters in path.

If its not possible to do this with rimraf, is there any other simpler solution using node js? The tedious solution might be to write my own script to call rimraf recursively after I get directory structure using fs or something.

P5.js – Change pixelDensity midway through running the sketch

Im trying to change the sketch’s pixel density after its been first initilized in setup. Basicly, user can interact with some UI inputs and it should change pixelDensity based on that. However I haven’t found way to actually change the pixelDensity other than the one instance in setup().
Is it even possible?

This is a simplified version of my code.
There is an event handler that calls updateSettings() on input event on the input element.


let pd = 2
setup() {
  createCanvas(windowWidth, windowHeight)
  pixelDensity(pd)
}

function updateSettings(target) {
  if (target.name == "pixelDensity" && pd != target.value) {
    pd = target.value
    changePixelDensity()
  }
}

function changePixelDensity() {
  pixelDensity(pd)
}

What im trying to do is let user change the pixel count of the sketch to hopefully lower the impact on CPU, then after everything is generated, user can put back the pixel density to draw the sketch in full detail.

How to access Polymer minified functions from a browser’s console

I been trying to understand what part of code on youtube.com does redirect you to another site when clicking on a link in the description. For that I have tried to prevent all events to run in relation to the clicked element, but that does not help:

Object.keys(window).filter(
  k => /(?=^on)(?!.*move)(?!.*pointerup)(?!.*auxclick)/.test(k)
).forEach(key => {
  et.addEventListener(key.slice(2), ex => {
    console.log(`stop: ${key}`)
    ex.stopPropagation()
    ex.preventDefault()
  })
})

So I went to the browser console and checked which function is called when the button is pressed. However, when I try to call this function from the debugger, I get the undefined value.

Can someone explain why these functions are not accessible, and it’s not possible to overwrite them, even from an extension code?

Trap array changes (add/delete) inside object of proxy

I am trying to track some array changes inside of proxyfied object.
For example:

object = { 
    count: 0, 
    input: ``, 
    tasks: [ ] 
} 

and I need to track changes of object.tasks.

The problem is that proxy catches all changes (set, get etc.) related to object, and even array (object.tasks) sets (means event ‘set’ fires and traps array changes, but not removes (delete) like delete object.tasks[someIndex], or changes like array.filter((x, index) => index !== some) and so on.

So my question is: what’s the proper way to trap this changes?

Vue 3 – Using store data to check a checkbox if already selected

So I’m working on a multi-step form, on step 3 there’s a few checkboxes. When clicked on, the data from the checkbox is sent to a store array and when unchecked, that data is filtered out.

What I’m trying to do is click one of the checkboxes, go to the next step, go back, and have that specific checkbox still appear checked. Right now, when I go forward a step then back, all checkboxes revert to being unchecked.

I tried a ternary comparing the name in the addons store to the input’s value and if it matches within the store, set the checked status as true

 :checked="addons.value.name === $event.target.value ? true : false"

But that didn’t work (also swapped :checked for v-model). I’m getting an error “Cannot read properties of undefined(reading ‘name’). I think I’m having trouble accessing objects within the addons store.

Store

export const addons = ref([]);

Input

 <input
            :id="props.name"
            type="checkbox"
            :value="props.name"
            :data-amount="props.amount"
            :data-cost="props.cost"
            name="add-ons"
            class="w-5 h-5 mr-2 text-blue-600 bg-gray-100 border-light-gray rounded"
            @click="(event) => addToAddons(event)"
        />

Function ()

const addToAddons = (event) => {
    if (event.target.checked === true) {
        addons.value = [
            ...addons.value,
            {
                name: event.target.value,
                cost: event.target.getAttribute("data-cost"),
                amount: event.target.getAttribute("data-amount"),
                checked: true,
            },
        ];
    }

    if (event.target.checked === false) {
        const filteredAddons = addons.value.filter(
            (a) => a.name !== event.target.value
        );
        addons.value = filteredAddons;
    }
};

Binding two checkboxes to one boolean inside the Spring Controller

I’m trying to implement basic vote system similar to Youtube’s.
I want to set the boolean value to true when the first checkbox is checked and set it to false when the second one is checked. I want to delete the variable entirely when nothing is checked so the Controller will know to delete the value from the database.

The problem is that I’m too dumb for this atm since it’s the first time I’m doing something like that and I’m barely understanding the syntax.

Below I’ll share my code with you.

Script meant to uncheck the box which is not touched atm and remove the value

    <script>
                    //this abomination was supposed to create new blank value so that the function
                    //works when no vote is present inside the database

                    //let upvoteInput = document.createElement('input');
                    //upvoteInput.type = 'hidden';
                    //upvoteInput.name = 'upvote';
                    //document.querySelector('form').appendChild(upvoteInput);

            function updateCheckboxes(first, second)
            { 
                if (first.checked)
                {
                    second.checked = false;
                }
                else if (second.checked)
                {
                    first.checked = false;
                }
                else
                {
                    upvoteInput.remove();
                }
            }
      </script>

Form meant to execute the script. From what I understand, the value stays the same because of the <input type="hidden" name="upvote" th:value="${upvote}"/> and it’s clear to me, however any other ideas were even less successful.

<form th:action="@{/products/{productId}/features/{featureId}/votes(productId=${feature.product.id},featureId=${feature.id})}" method="post">
    <div th:text="${upvote}">
            
    </div>
    <div th:text="${upvoteSum}">
        
    </div>
    <input type="hidden" name="upvote" th:value="${upvote}"/>
    <div class="form-check">
        <input class="form-check-input" type="checkbox" id="vote" onclick="updateCheckboxes(this, document.getElementById('downvote'))">
        <label class="form-check-label" for="vote">
            upvote
        </label>
        </div>
        <div class="form-check">
        <input class="form-check-input" type="checkbox" id="downvote" onclick="updateCheckboxes(this, document.getElementById('vote'))">
        <label class="form-check-label" for="downvote">
            downvote
        </label>
    </div>
    <button type="submit" class="btn btn-outline-info" style="--bs-btn-padding-y: .6rem; --bs-btn-padding-x: 1.2rem; --bs-btn-font-size: 1.0rem;">temporary button</button>
</form>

Method inside the FeatureController. I think things are working correctly here.

    @PostMapping("{featureId}/votes")
    public String updateVotes(@AuthenticationPrincipal User user, Feature feature, @PathVariable Long productId, @PathVariable Long featureId, @ModelAttribute("upvote") Boolean upvote)
    {
        Optional<Feature> featureOpt = featureService.findById(featureId);
        if(featureOpt.isPresent())
        {
            feature = featureOpt.get();

            Vote vote = upvoteRepo.findByPkUserAndPkFeature(user, feature);
            vote.setUpvote(upvote);
            upvoteRepo.save(vote);

            //I will get to that 
            /*{
                VoteId voteId = new VoteId();
                voteId.setUser(user);
                voteId.setFeature(feature);
        
                Vote vote = new Vote();
                vote.setPk(voteId);
                vote.setUpvote(upvote);
                upvoteRepo.save(vote);
            }*/
        }
        return "redirect:/products/" + productId + "/features/" + featureId;
    }

Vote entity

package com.freshvotes.domain;

import jakarta.persistence.EmbeddedId;
import jakarta.persistence.Entity;


@Entity
public class Vote
{
    private VoteId pk;
    private Boolean upvote;

    @EmbeddedId
    public VoteId getPk()
    {
        return this.pk;
    }
    public void setPk(VoteId pk)
    {
        this.pk = pk;
    }

    public Boolean getUpvote()
    {
        return this.upvote;
    }
    public void setUpvote(Boolean upvote)
    {
        this.upvote = upvote;
    }


    @Override
    public String toString()
    {
        return String. valueOf(getUpvote());    
    }
}

VoteId




import java.io.Serializable;

import jakarta.persistence.Embeddable;
import jakarta.persistence.ManyToOne;

@Embeddable
public class VoteId implements Serializable
{
    private static final long serialVersionUID = 943424757L;
    private User user;
    private Feature feature;

    @ManyToOne
    public User getUser()
    {
        return this.user;
    }
    public void setUser(User user)
    {
        this.user = user;
    }

    @ManyToOne
    public Feature getFeature()
    {
        return this.feature;
    }
    public void setFeature(Feature feature)
    {
        this.feature = feature;
    }
}

Integrar formulario en pagina web [closed]

Hola comunidad tengo un problema que no se como resolver tengo dos pagina web que está en un dominio
una de estas tiene un formulario que tiene varios campos uno de ellos son imagenes varias imagenes

Yo necesito que cuando se envie el formulario de la pagina web automaticamente se cree una tarjeta en la otra pagina como si fuese un catalogo de producto actualmente se un poco de html css y javascript
¿Me podrian ayudar dandome una serie de pasos para culminar mi proyecto?

no tengo nada aun pero si me dan una serie de pasos lo podria investigar y resolver

Shadcn-ui initialization command gives npm internal Error, says ERR_INVALID_URL. This was performed on a PC running on proxy in a Windows environment

Context:
I stay in college dorms, so I need to use college proxy for internet access.

So, recently I tried to use ShadCN for my latest project. After adding components to the files as directed by the official documentation, I had to run the command
npx shadcn-ui@latest init

But, when I run it, I get the following error:

node:internal/errors:477
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:387:5)
    at URL.onParseError (node:internal/url:564:9)
    at new URL (node:internal/url:640:5)
    at new HttpsProxyAgent (C:Users{My name}AppDataLocalnpm-cache_npx125ee17d583c4e03node_moduleshttps-proxy-agentdistindex.js:56:50)
    at file:///C:/Users/{My name}/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/shadcn-ui/dist/index.js:2:3169
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12) {
  input: '{The proxy}',
  code: 'ERR_INVALID_URL'
}

What are the reasons there could be such an error and do you all know any way to fix it?

Thank You!

I looked it up on Google and scoured forums that address the problem but to no avail.