Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
Calling the button action on a foreign page

I am looking for information on triggering a button action on another page.

I wrote something like this:

<form id="myForm" action="https://example.com/shop/product/x/" method="post" enctype="multipart/form-data">
    <script>
        document.getElementsByName("add-to-cart")[0].click()
    </script>
<input type="button" onclick="myFunction()" value="Submit form">
</form>

<script>
   function myFunction() {
   document.getElementById("myForm").submit();
   }
</script>

Shop's button:

<button type="submit" name="add-to-cart" value="146335" class="single_add_to_cart_button button alt">Add to cart</button>

I need a script that, after transferring to the store's website, will add the product to the cart for the customer. Can someone bring me closer to the solution?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!