Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

using a value list to define a text input field

Featured Replies

What I am trying to accomplish is to have the user be able to search through different file maker fields but chosing the field through a html form value list and then typing their search criteria, then click find

for example If a user wishes to find items by company they would chose "company" from the pull down list, type in the company name and click the search button.

Or

If the same user wanted to find items by model number they would choose "model number" from the pull down list, type the model number and click the search button.

The code below is the html equivalent of what I want. (sorta)

The values in the value list (sku, compname, description, etc) are fields in filemaker. Do I do something with the names of these fields? I know I can simply change the value name in my input text to reference one field.

eg. <input type="text" size="20" name="compname" value=""> will return a search with the specific name. Does the solution have anything to do with $_POST?

<td VALIGN="top" HEIGHT="37">

<select name="????" id="?:??">

<option selected="selected" value="sku">Model Number</option>

<option value="compname">Manufacturer</option>

<option value="description">Description</option>

<option value="area_of_expertise">Area of Expertise</option>

<option value="date_added">Date Added</option> </select>

</td>

<td ALIGN="left" VALIGN="top" HEIGHT="37">

<input type="text" size="20" name="?:???" value="">

</td>

<td ALIGN="left" VALIGN="top" HEIGHT="37">

<input type="submit" name="currentQuery" value="Find Items"></td>

Your Form could be like this:

<select name="fmfield">

<option value="sku" selected>Model Number</option>

....

</select>

<input type="text" name="fmvalue" value="">

......

Then in the php script you would remake the FM query with the appropriate Field Name and Value. For example:

$fmField = $_POST["fmfield"];

$fmValue = $_POST["fmvalue"];

$fmQuery = new FX($myIP,$myPort);

$fmQuery->AddDBParam($fmField, $fmValue, 'eq');

......

Good Luck.

Garry

  • Author

It worked brilliantly.

I had a feeling I was close.

Thanks for the much needed info.

Greatly appreciated.

one tiny problem though.

Now I can not do partial searches. For example I can not search for a model number using part of it's sku. eg. I can not type "CDM" to find a model called CDM-500

  • Author

never mind. I just removed the 'eq' from the AddDBParam. (you do not need this param in order to make the AddDBParam function work)

Guess I should read the FX.php file a bit before replying to the post.

Thanks again Garry for the post.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.