Daniele

How to access a Form Builder field entry?

Recommended Posts

Any idea how I would go about doing that? Sorry im still pretty nood at PHP, thanks for the help :)

Share this post


Link to post
Share on other sites
15 hours ago, bramwolf said:

I'm trying to sort the foreach results from FormBuilder but I can't seem to sort it by a field, only by created.
How would you go about doing so?

You can get the array of entries and then do a usort():

$entries = $forms->get('reserveren')->entries()->find('');
// sort entries newest to oldest by field 'datum'
usort($entries, function($a, $b) {
    return $b['datum'] - $a['datum'];
});
// OR, sort entries oldest to newest by field 'datum'
usort($entries, function($a, $b) {
    return $a['datum'] - $b['datum'];
});
// do what you want with $entries array

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Robin!

That did the trick perfectly! I'm adding this to my FormBuilder Readme file, and I think stuff like this should be included in it
by standard. Most people say this isn't even possible, now it turns out it is, it would be nice if a hunt for this kind of syntax
wouldn't take 2 hours.

Thanx again :)

Bram 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By GeekMan
      When I create a form with FormBuilder, is there a way to stop it from showing the vertical scroll bar on the right side of the form page??? For example look at this page.
      http://www.cji.edu/registration/reg-lemd/?course_name=Effective Report Writing&course_date=December 6, 2017
      Why does it even have a scroll bar?
    • By cosmicsafari
      Hi all,
      A few of our clients are having issues receiving emails sent via form builder after a client submits a form.
      They display fine in certain clients but in Outlook especially the body content is either missing or the raw code is displayed.
      Does anybody have any ideas why this might be the case or any ideas about how to diagnose the issue?
      Not sure if this is an issue with the emails themselves or the server from which they are being sent.
      Just wondering if anyone else has experienced anything similar?
    • By AndySh
      Hello!
      I need your assistance please. I purchased the module FormBuilder. Unfortunately, the module discontinued delivering customer submissions to e-mail box specified in the module settings. Direct mailing to the e-mail box works OK. The module settings stays the same and are correct, like "Send e-mail to administrator(s) is checked. The last version of FormBuilder 3.0 has been installed. Please advise how to resolve the issue becase I cannot get orders from customers anymore (((
    • By neonwired
      Formbuilder isn't redirecting either using the path or the page ID, it just prints them as a message.
    • By ank
      I'm thinking of buying FormBuider,
      but first i want to know if i can use it for my needs.
      I checked the features of FormBuilder and found these:
      Send an auto-responder Conditionally email form submission to different people based on field values Display a success message, redirect to another URL or pull text from another page to display after form submission but i want to know, if its possible combine these to:
      redirect to a page that displays content based on (different) fields values just submitted from the form?
      or
      auto-respond a email based on the field values.

      example:
      if $formfield1="elephant" -> echo "your choice was an animal"
      if $formfield2="blue" -> echo "you selected a blue elephant"
      ...
       
      Thanks