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

301
Views
I cannot submit a form neither using .click() nor using .submit()

In an external webpage that I do not administrate, I have to fill a form that has no id or name. The "submit" button code looks like this:

<button type="submit" class="sui-AtomButton sui-AtomButton--primary sui-AtomButton--solid sui-AtomButton--center">
  <span class="sui-AtomButton-inner">Save</span></button>

At first I tried a simple click like this:

await.page.click('[type="submit"]')

The button was clicked but it did not trigger the submition of the form (I also tried using "Enter" with the keyboard, but the result is the same).

Then, I tried to trigger the submit from the own form like this:

await page.evaluate(() => {
      
 document.forms[0].submit();

})

and like this:

await page.evaluate(() => {
 
 var f = document.forms[0]
 Object.getPrototypeOf(f).submit.call(f);

})

and also like this:

await page.evaluate(() => {
      
 document.forms[0].submit(function(event){
   event.preventDefault();
 });

})

In all the three cases the result is an error in the page.

What should I do? Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

See that in your JS code you don't have this:

e.preventDefault();

if you have this code then it will prevent the form to be submitted.

about 4 years ago · Juan Pablo Isaza Report
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!