Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9140661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:32:44+00:00 2026-06-17T09:32:44+00:00

I am able to fill input fields with values (strings) using the $fields[] array

  • 0

I am able to fill input fields with values (strings) using the $fields[] array in a function I call using [!eForm? … &eFormOnBeforeFormParse … !]. I tried to submit a string value to the select box, but this does not work. I guess that the select box is an array instead of strings. I did not find a documentation about the structure of this array or how I can control it.

So my question is: How can I preselect the select box based on the data I find in my database?

I appreciate any help. (Your answer does not need to contain database calls, though.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:32:45+00:00Added an answer on June 17, 2026 at 9:32 am

    Just figured it out myself:

    Select boxes allow multiple selections. I forgot about this, because you do not see this very often. Therefore, the value has to be an array to allow multiple selections. So when you have one pre-selection, wrap it in an array. For instance:

    $fields[‘state’]=array(‘CA’);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not able to store all binary data values into sqlite3 table using QT. For
Would someone be able to help here? I would like to fill a div
Im able to populate my formset with the elements of an array which is
I'm working on a website where the user should be able to fill out
I'm trying to fill out a form containing a textarea element. I'm using Python
I'm using JQuery Masked input plugin. $(#percent).mask(99.99?9); This allows numbers like 10.999, 10.99, 01.999,
I'm using Jeditable (posting to CakePHP) for input on my page. I want users
So basically I want to fill an array with objects and then display it.
I populate a list of <form> using a PHP while loop, and fill the
I have a form into which the user can add more fields to fill

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.