× Form Help

Edit options in Drop Down List

  • ante
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 60
  • Thank you received: 0

ante replied the topic: Edit options in Drop Down List

Like magic... or you are magic. Thank you.
#234500
  • Posts: 2282
  • Karma: 84
  • Thank you received: 306

mihaela replied the topic: Edit options in Drop Down List

Thank you once again for the kind words. :)

Regards,

Mihaela
#234529
  • ante
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 60
  • Thank you received: 0

ante replied the topic: Edit options in Drop Down List

Hello Mihaela

Picking up this thread again. Everything you helped me with earlier works perfectly.

I am now advancing to use the Advanced Filter Module and here is the issue.
Whenever I want to populate the filterdropdown for the "CampaignName" element that we worked on during this thread, it only picks up what is in the element settings in the backend. So it does not consider what I have edited from the textArea that you helped me create.

Anything we can do here?

Best regards,
Ante
#234638
  • Posts: 2282
  • Karma: 84
  • Thank you received: 306

mihaela replied the topic: Edit options in Drop Down List

Hello,

I think I understand what is the issue. As far as I can think of, only one thing that could make this two things both function is to update data2 column in #__facileforms_elements table.

Here are instructions how to do so.

Please go to End Submit pieces of the form with Textarea containing the possible options. Put there the following code:
// old part of the code
$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object

$test = ff_getSubmit('options');
$test = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $test);

$opts = "";
foreach(preg_split("/((\r?\n)|(\r\n?))/", $test) as $line){
    $line = trim($line);
    $line = str_replace(' ', '_', $line);
    $opts.= $line ."\n";
}


$db->setQuery("UPDATE #__facileforms_subrecords SET value ='$opts' WHERE element = 254 AND record = (Select Max(id) From #__facileforms_records Where name = 'QuickForm525934685') "); 
$db->execute();

// new part of code

$db2 = JFactory::getDBO();//Get Database Object
$opts2 = "0;Choose option;\n";
foreach(preg_split("/((\r?\n)|(\r\n?))/", $test) as $line){
    $line = trim($line);
    $line = str_replace(' ', '_', $line);
    $opts2.= "0;". $line .";". $line ."\n";
}
$db2->setQuery("UPDATE #__facileforms_elements SET data2 = '$opts' WHERE id = 27179"); 
$db2->execute();

NOTE: You have to replace 27179 with the ID of the select list element. The old part of the code can stay the same as it currently is in your form.

Let me know whether this resolves the issue.

Regards,

Mihaela
#234643
  • ante
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 60
  • Thank you received: 0

ante replied the topic: Edit options in Drop Down List

Hello Mihaela

Thanks, this seem to work... but not for the field I expected.

My CampaignName field has ID 18 in the __facileforms_elements table, so that is what I am using.

The issue now, and honestly I think it was there before this tweak, just I did not notice it.
I have three elements; SelectList "CampaignName" with ID 18, Calendar "CampaignStartYearMonth" with ID 184, and then Hidden input "FullCampaignName" with ID 569. The Last one is a joint between the first two done with a function in initialization script:
ff_getElementByName("FullCampaignName").value = ff_getElementByName("CampaignName").value + "_" + ff_getElementByName("CampaignStartYearMonth").value;

Logging is checked for all elements above except for the calendar where it is not available.

So to the issue. Whenever a form is filled and submitted the The "FullCampaignName" value is stored, and I can then list it in for instance ContentBuilder. But the CampaignName is empty... blank... nada.
To be honest I am not sure when this may have started since I was always checking the FullCampaignName assuming CampaignName should be ok since it was part of the creation of FullCampaignName. Now when I want to use the Campaign Name in filtering, I suddenly realize that is not the case.

A hint could be when I open a submitted record in ContenBuilder to EDIT for the first time, the CampaignName field is Empty and I need to chose a value from the dropdown. Other dropdowns have kept whatever value they had when first submitted. Saving the record and then Edit again, everything seem fine.

Sorry for the essay above :-)

Any idea?

Best regards,
Ante
#234660
  • ante
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 60
  • Thank you received: 0

ante replied the topic: Edit options in Drop Down List

Hello Mihaela
Sorry to disturb you again. Not sure if you have had the opportunity to look at my previous posting.

To conclude, it seem like the Select List element value that we are populating through textArea in a different form, does not store the values in database when form is first submitted. So when user picks a value in the drop down, the value from this is not stored on submit. When user chose to edit the same record (I have CB installed) all other drop downs in my form have the previously chosen values preselected, except from the mentioned element which is empty and needs to be reselected.

I realize that you have helped me with so much customization so it might be hard to spot the issue... but do you have any idea?

Best regards,
Ante
#234796
Moderators: ForumSupporttomeperica
Time to create page: 0.077 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here