TOPIC:

Spalte aus SelectList auslesen und an Feld übergeben 3 years 18 hours ago #230576

  • Topic Author
  • Missionar
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
Hallo zusammen,
ich hole mir über SelectList aus meiner Joomlatabelle :"Orte", die ID des Ortes und den Namen des Ortes, (z.B. 1;Köln) lasse mir mit SelectList nur den Namen anzeigen und speicher allerdings die ID ab. Muss so sein.

Jetzt brauche ich aber noch in einem Feld in meinem Formular, nennen wir es mal "geheim", auch den Ortsnamen.
Ich habe folgenden Code:

$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object
//Abfrage Ort
$db->setQuery('Select id,value From xy_towns ');

$result = $db->loadrowlist(); //load the result from the query
$test = "0;Bitte wählen Sie den Ort aus;0\n";

for ($i = 0; $i < count($result); $i++)
{
$test .= "0;".$db->loadColumn(1)[$i].";".$db->loadColumn(0)[$i]."\n";
}
function ff_setSelectList($name, $value)
{
global $ff_processor;
for ($r = 0; $r < $ff_processor->rowcount; $r++)
{
$row =& $ff_processor->rows[$r];
if ($row->name==$name)
$row->data2 = $value;
unset($row);
}
}
ff_setSelectList('ObjektOrt', $test);

Es wird also in meinem SelectList Feld "ObjektOrt" nur der Name angezeigt und die ID gespeichert. Soweit alles gut.
Wie bekomme ich jetzt den Namen des Ortes in mein Feld "geheim" gespeichert???

Please Log in or Create an account to join the conversation.

Spalte aus SelectList auslesen und an Feld übergeben 3 years 14 hours ago #230583

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

I hope that we can continue in English since we're a bit low on German speaking staff at the moment.

To achieve what you want navigate to Advanced options of the select list element. Then in the Actionscript tab, set Type to Custom and Action to Change.
In the code area bellow paste the following code:
function ff_selectlistname_action(element, action)
{
    var a = JQuery("[name=\"ff_nm_selectlistname[]\"] option:selected").text();
ff_getElementByName('secretfiledname').value = a;
NOTE: In the code above replace every instance of selectlistname with the Name of the select list element.
Also, replace secretfiledname with the Name of the secret field that you want to paste the name of the city to.

Let me know whether you have managed to set this for your form and whether it works as you wanted.
If you have more questions, feel free to ask.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

Spalte aus SelectList auslesen und an Feld übergeben 3 years 14 hours ago #230589

  • Topic Author
  • Missionar
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
Many thanks for the help,
Unfortunately it does not work.
And it is no longer possible to switch to the second page of the form by clicking "next".

Please Log in or Create an account to join the conversation.

Last edit: Post by Missionar.

Spalte aus SelectList auslesen und an Feld übergeben 3 years 13 hours ago #230592

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello again,

It should work if you have your form's textfield and select list Names (not Titles) correctly inserted in the provided code
I assume there is an error in your code which is not allowing you to go to the next page.

Please send me the Actionscript code from the select list element so I can take a look. Also, could you send me a link to your form so I can check whether there are some errors in the console.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

Spalte aus SelectList auslesen und an Feld übergeben 3 years 12 hours ago #230595

  • Topic Author
  • Missionar
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
I am currently working locally and unfortunately can not send a link.
Here is the code of the action script:
function ff_ObjektOrt_action(element, action)
{
var a = JQuery("[name = \ "ff_nm_ObjektOrt [] \ " ] option:selected").text();
ff_getElementByName('geheim').value = a;
}

Please Log in or Create an account to join the conversation.

Last edit: Post by Missionar.

Spalte aus SelectList auslesen und an Feld übergeben 3 years 11 hours ago #230602

  • Topic Author
  • Missionar
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
These are the error messages on the console:

Leerer String an getElementById() übergeben.
jquery.min.js:2:24932
[Mitteilungsdetails anzeigen/ausblenden] ReferenceError: ff_ObjektOrt_action is not defined[Weitere Informationen] immobilie-zum-tausch-anbieten.html:1:1
Leerer String an getElementById() übergeben.
jquery.min.js:2:24932
[Mitteilungsdetails anzeigen/ausblenden] ReferenceError: ff_validate_nextpage is not defined[Weitere Informationen] immobilie-zum-tausch-anbieten.html:1:1
Leerer String an getElementById() übergeben.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.051 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!