Joomla 5 Mitteilung

Wir freuen uns mitteilen zu können, dass seit dem 29. Januar 2024 alle unsere Joomla Erweiterungen mit Joomla 5 kompatible sind.

Für alle die gerade noch von Joomla 3 auf 4 aktualisieren: Anleitungen für die Joomla 4 Migration gibt es hier:

Es gibt nun auch eine eigenständige Dokumentation für Visforms für Joomla 4 und für Visforms auf Joomla 5

Forum

Visforms Subscription Inhaber können in unserem Forum Fragen stellen. Bitte mit dem entsprechenden Benutzer anmelden.
Jeder kann lesend auf das Forum zugreifen.

Bitte stellen Sie nur 1 Frage pro Thema.

How to create 'Reload on change of' button to click ??

Mehr
1 Jahr 7 Monate her #8412 von skidowitz
Hello ,I have created a form that uses a large sql database. i need to make a search box. currently i made a text field, sql select field and radio button. The radio button is a triger to "reload on change" for sql select wich got as a arument a text field.

I prefer to create button to click "serch".
Have You any ide to create solution for thiese ??

Mehr
1 Jahr 6 Monate her - 1 Jahr 6 Monate her #8419 von Administrator IV
Hello skidowitz,

it is possible to configure a button with its own button text that triggers the reloading of a 'Select SQL' field.
Again, sorry for the late reply, but I needed to think about this for some time first!

The solution works fine in my example below.
It can be achieved through pure configuration.

The form 'test-sql-tables':
Template is standard Cassiopeia with no special configuration regarding layout.
This is a Bootstrap 5 layout.

The field 'checkbox1':
Is a checkbox that is used alone to create the button.
This is done by specifying your own Bootstrap 5 classes in the field configuration.
Your value is irrelevant.

The CSS classes used are explained here:
getbootstrap.com/docs/5.0/forms/checks-radios/#toggle-buttons

The field 'text1':
Is a simple text field and is used for demonstration purposes in the SQL of the field 'sql-checkbox1'.

The field 'sql-checkbox1':
This is the actual 'Select SQL' field.
It uses the value of field 'text1' in its SQL statement for demonstration purposes.

Its reloading is triggered by the field 'checkbox1', which is displayed with Bootstrap 5 as a button.
It is also triggered by the 'radio1' and 'radio2' fields for demonstration purposes.

The reloading becomes visible by the fact that the displayed time is updated after clicking on the 'Update sql-checkbox1' checkbox button.
The current text from the 'text1' field is also used for the display.

Screen Shots:

The screen shot of the displayed 'test-sql-tables' form:
vi-solutions.de/forum-uploads/reload-on-button-click_form.png

The screen shot of the configuration of the field 'checkbox1':
vi-solutions.de/forum-uploads/reload-on-..._field_checkbox1.png

The screen shot of the configuration of the 'text1' field:
vi-solutions.de/forum-uploads/reload-on-...lick_field_text1.png

The screen shot of the configuration of the 'sql-checkbox1' field:
vi-solutions.de/forum-uploads/reload-on-...ld_sql-checkbox1.png

Any other UI element

If any other UI elements should lead to the 'Select SQL' field being reloaded when clicked, then this is also possible.
In this case, a really small snippet of PHP code (or the JavaScript part of it) needs to be included in the template in one way or another.
But it is possible.

For example, for the 'checkbox1' field, the additional PHP code in the template would be something like the following.
However, it is not necessary in the above case.
Code:
?><script>     jQuery(document).ready(function() {         jQuery('#form15checkbox1lbl').click(function() {             event.preventDefault();             $('#field149').trigger("change");         });     }); </script><?php

The jQuery selectors refer to the HTML IDs of the affected UI elements.

'15' = the form ID.
'checkbox1' = the field name of the trigger.
'form15checkbox1lbl' = the HTML ID of the trigger HTML element (can be any UI element)
'149' = the field ID of a valid field to trigger the reload (must be configured as a trigger field in the reload field).

The trigger HTML element:
Code:
<label class="  visCSSlabel visCheckbox btn btn-primary" id="form15checkbox1lbl" for="field149">Update sql-checkbox1</label>

The reload HTML element
Code:
<input class=" visCSStop10  btn-check" id="field149" data-error-container-id="fc-tbxfield149" aria-labelledby="form15checkbox1lbl" name="form15checkbox1" value="1" type="checkbox">

Kind regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
Letzte Änderung: 1 Jahr 6 Monate her von Administrator IV.

Moderatoren: Administrator AVAdministrator IV
Powered by Kunena Forum