Jump to content
  • 0

Multiple Values in a Single Field


Jnelson

Question

Hello,

My database lists summer programming opportunities for students from elementary through high school. I've created a form that people can use to search the database of programs. One field I have in the table is "grade level," so that parents can search for programs suitable for their child's age. The problem is, many programs have offerings for a variety of grade levels, for example Middle School and High School or Elementary and Middle. So, in addition to allowing multiple selections in my search form list, I need to store multiple values in my grade level field in the table (sort of like Access's "lookup field" feature). My goal is to allow users to search for MS, for example, and return all programs that include MS grade level programs, even if those programs also allow other grade levels.

The way it is now, I have to have the following options in the "grade level" field: ES, ES/MS, HS, MS, MS/HS, All. This is a cumbersome list and forces users to search for All, ES/MS, MS, and MS/HS if they want to view every program that includes a Middle School option. There has to be a better way--I just can't figure out what it is.

I'd appreciate any help someone can offer me!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi, Here's a workaround solution. In the form used to submit the summer programming opportunities, make the grade level field a listbox and simply include 3 options: ES, MS and HS. Then use the method instructed in the following link to enable multi-selection on the listbox field: http://forums.caspio.com/index.php/topic/3148-js-select-multiple-values-from-a-listbox-in-a-webform/. On the search form of your Report DataPage, also include the grade level field as a listbox. You can simply check the "allow multi-select" checkbox and use the "match any(OR)" option. Note to change the "comparison type" from "equal" to "contains". In this way, you can submit multiple options and search on multiple options as well.

Link to comment
Share on other sites

  • 0

Hello,

I successfully implemented the solution you provided below, including using the javascript in the footer of my datapage.

Now, I am in the process of adding a couple of new datapages so that admin users of the database can search for and then edit records. I used the same technique you describe below to allow multiple-select in my list box on this new search form as well. However, when users proceed to the EDIT page, I am unable to achieve the same functionality. The multi-select no longer works on the edit page. In fact, in addition to the three values I provide in this field (ES, MS, HS), the string of values for that record also appears in the list box. So for example the listbox might give these options:

ES

MS

HS

ES, MS

At that point, the user can select any ONE of these values, but not multiple. My goal is to have the listbox on this form show

ES

MS

HS

and allow users to again CTRL+select to select (or deselect) multiple choices.

Any thoughts would be greatly appreciated!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...