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

169
Views
Button execute a form in another function in react

I need the Formulario() function to be opened by the "Eu li, concordo e aceito" button.

  async function Formulario() {
    const schema = Yup.object().shape({
      nome: Yup.string().required("Obrigatório!"),
      cpf: Yup.string().required("Obrigatório!"),
    });

    const submitvalue = () => {
      const frmdetails = {
        'Nome': nonce,
        'Cpf': cpff
      };
    };

    return (
      <ModalContent>
        <h2>Dados do assinante</h2>
        <Form schema={schema}>
          <Row>
            <Col>
              <Input
                type="text"
                placeholder="Nome"
                onChange={e => setNome(e.target.value)}
              />
            </Col>
          </Row>
          <Row hascols>
            <Col>
              <InputMask
                type="text"
                placeholder="Cpf"
                onChange={e => setCpf(e.target.value)}
              />
            </Col>
          </Row>
          <ModalFooter>
            <Button
              onClick={() => {
                submitvalue();
                aceitarTce();
              }}
              block
              variant="tangerine"
            >
              Aceitar
            </Button>
          </ModalFooter>
        </Form>
      </ModalContent>
    );
  } 

The button is in return for the export default function, where the async function is inserted.

  return (
      <Controles>
        {showControlls && (
          <>
            <Button
              variant="tangerine"
              onClick={() => Formulario()}
              loading={loading || undefined}
            >
              Li, concordo e aceito
            </Button>
            <Button onClick={recusarTce} loading={loading || undefined}>
              Recusar o contrato
            </Button>
          </>
        )}

I've tried several ways and I couldn't, I ask for someone's help. Code made in react.js and javascript, with backend in PHP and Slim framework.

about 4 years ago · Santiago Trujillo
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!