Jump to content

This topic is 7337 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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>

Posted

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

Posted

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

Posted

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.

This topic is 7337 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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