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.

How to find a range value

Featured Replies

Hi,

i try to make a form to search a range value

with the old cdml i used

 



        <select size="1" name="-op">

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

        </select>



        <input type="text" name="field1" size="10"/>



        <select size="1" name="-op">

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

        </select>



        <input type="text" name="field1" size="10"/>





 



Now with xsl i tried to do



 
 





        <select size="1" name="field1.op">

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

        </select>



        <input type="text" name="field1" size="10"/>



        <select size="1" name="field1.op">

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

        </select>



        <input type="text" name="field1" size="10"/>



 

but doesnt't work..

someone can help me?

thank you! :

Do you have the -lop (logical operator) of AND to make sure this insert both values?

Beverly, -lop=and is the default setting.

The problem actually is that field.op=gt and field.op=lt just work for words and can not be combined. The query specification in the CWP Guide is not clear about that.

I had made once a whole test series that combines different fields and operators, and sent it to FMI, because there are still bugs, especially with field.op=neq . If wished so, I can publish it here.

What you can do, however, is something along the following line:

<input type="hidden" name="field1.op" value="bw"/>

<input type="text" name="field1" size="11" value=">"/>

<input type="hidden" name="field1.op" value="bw"/>

<input type="text" name="field1" size="11" value="<"/>

This is based on the fact that you can use together with "field.op=bw" the field operators that are used within FM Pro.

E.g. for a range search: field.op=bw and field=startrange...endrange

The solution above is still not very pleasant, because the ">" and "<" can be overwritten by the user. I am not sure if this would work as well:

<input type="hidden" name="field1.op" value="bw"/>

<input type="hidden" name="field1" value=">"/>

<input type="text" name="field1" size="10"/>

<input type="hidden" name="field1.op" value="bw"/>

<input type="hidden" name="field1" value="<"/

<input type="text" name="field1" size="10"/>

But just try it out.

If you want to see a very flexible solution, have a look at

http://www.clicaps.ethz.ch/fmi/xsl/search_advanced_en.xsl

and try to search for Title = phys chem and Year > 1990 and Year < 2000.

It looks simpler than it is. There are actually several XSLT stylesheets, JavaScript and XML files with query translation rules involved. And the search is done in two databases at the same time (federated search).

Yep "-lop=and" is the default, unless the user has used "-lop=or".... ???

Thanks for the tip using ">" instead of "gt" for numbers, dates!

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.