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

119
Views
Typo3 jQuery OnClick Events

i need some help for my fresh installed Typo3 Website.

I want to set new Values within my DataBase via jQuery onClick Event. So i guess i need to make use of this class: TYPO3\CMS\Core\Database\ConnectionPool. Can someone Guide me how i can make use of this class within JavaScript.

I already tried the following, but i can't get it to work

define(['jquery', 'TYPO3\CMS\Core\Database\ConnectionPool'], function($, conPool) {

   if(conPool.foo == 'bar'){
      conPool.init();
   }
});

Typo3 source

I appreciating any Help. Thanks

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

0

Your frontend should not be allowed to communicate directly with the database of your TYPO3 instance.
If you allow it anyone can inspect your javascript and get credentials to access your database - and do anything they like. :(

The correct way is a server request with the data you want to change.
then some PHP can compute the data (verify, adapt, ...) and change the value in the database (as PHP has the local credentials to access the database). Then it's up to you to give a notice in the front end if that operation was successful or not.
Such a server-request could be a complete page request, but a simple AJAX-call would be enough. Though you does not need to rebuild the complete page. From the Return of that AJAX request you can show only a notice about failure or success as a flash-message or similar.

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!