Jump 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.

Alright You Web Experts! Here's another good one

Featured Replies

Hi Everyone!

I'm back again with more goodies!

Scinario:

I'm creating a pop-up window for searching within' a database. I've managed to create the following:

Field Name Selection (drop down list)

Search Operation (drop down list)

Text Field for data to be found.

JavaScript:

function show(field1,dummy1){

var selected1= field1.selectedIndex;

var fname1 = field1.options[selected1].text;

document.find[fname1].value=dummy1.value;

document.find.submit();}

HTML:

<a href="#" onClick="show(document.find.field1,document.find.dummy1);">Start Search</a>

<form action="FMPro" method="post" name="find">

<input type="hidden" name="-DB" value="[FMP-CurrentDatabase]">

<input type="hidden" name="-format" value="layout1.html">

<input type="hidden" name="-lay" value="layout1">

<input type="hidden" name="-find">

<table border="1">

<tr>

<td>

Field: <select name="field1">

<option></option>

[FMP-LayoutFields]

<option>[FMP-FieldName]</option>

[/FMP-LayoutFields]

</select>

<select name="-Op">

<option value="bw">Begins With</option>

<option value="neq">Omit</option>

<option value="eq">Exact</option>

<option value="cn">Contains</option>

<option value="ew">ends with</option>

<option value="gt">greater than</option>

<option value="lt">less than</option>

</select>

[FMP-LayoutFields]

<input type="hidden" name="[FMP-FieldName]" value="">

[/FMP-LayoutFields]

&nbsp;&nbsp;

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

</td>

</tr>

</table>

</form>

PROBLEM:

This works when there is only 1 set (field name, operator, data). I've taken the exact code (JavaScript & HTML) and duplicated it with new names. In theory that should work but I keep getting the "Record Not Found" error, but I'm looking at the database as it's processing, and it doesn't even process the find in the database. It does when there's only 1 set though.

Am I attacking this correctly?

Thanks!

~Addam~

Addam,

Are you able to check on the database to see "Modify Last Find"? Or, isn't it even getting to that stage?

I guess you have "Field1" and "Dummy1" as fields on your Layout.

Another thought is that each additional set is treated as a "AND".

Good Luck.

Garry

  • Author

Thanks for thet reply Garry!

To answer your question, it's not even getting to that stage. It seems to blow-up before it get's to the database.

Field1 & Dummy1 are 1 in the same. JavaScript is going to take the Field1 value and set it to the name of the one that has "[FMP-FieldName]" as the name. Then it uses the Dummy1 value and places it into the same "[FMP-FieldName]" value. That is the only one that get's processed. I think the other fields that didn't mean anything are the ones that were causing to cause the form not to work.

So I steped back and took another look. Since this will be a pop-up window, all I really need is to grab information then send it back to the original document for processing. Instead of adding another form to process on the main document (the same form I couldn't get to work), I just used the information gathered in the pop-up and used JavaScript to generate a new URL for the main document with the search information in it. Since there's only 4 options, it's not that bad.

It seems to work so far. I'll post it up once it's been fully developed just incase anyone would ever need it.

Thanks again for the reply!

Cheers!

~Addam~

Create an account or sign in to comment

Important Information

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

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.