close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Searching range for single field: best practice

Thread began 3/18/2013 10:50 pm by sysop349733 | Last modified 3/22/2013 2:42 pm by Jason Byrnes | 628 views | 6 replies |

sysop349733

Searching range for single field: best practice

Hello,

I am wondering what is the best practice for creating a search form that will search a single field for a range?

Specifically, I have a database column for "age." It shows up as an available option for a search page but, I'm not sure how to search that single field for both >= and <=.

DataAssist allows me to add "age" twice, but each time it is called "age" and I don't see a way to edit one as "minimum age" (>=) and the other as maximum age (>=).

What is the best way to search for a range on a single database column?

Sign in to reply to this post

Jason ByrnesWebAssist

In the Data Assist Create pages wizard, when setting up the search page, you can define a criteria for each filed, see the attached screen shot

Sign in to reply to this post

sysop349733

Thank you for the reply, Jason. That's the screen I've been using, but as I said, each time I add "age," once for the minimum and once for the maximum, it just uses the name of the database column "age" for both.

Can I edit the label for each age, so that I have "min age" and "max age" both searching on the column "age" through the DataAssist interface or do I have to dig into the HTML?

Sign in to reply to this post

Jason ByrnesWebAssist

You would need to change the labels after the search page is created.

Sign in to reply to this post

sysop349733

OK, thanks.

Sign in to reply to this post

sysop349733

It wasn't that simple.

One must edit the DataAssist search server behavior for the results page with Dreamweaver to give the fields that are searching the same column (age, in my example) a unique value. (I did MinAge and MaxAge.)

Then one must change the label, ID and name for those fields on the search page and, additionally, change the PHP that echos the values of those if set. Like this:

---------------------
<div class="lineGroup"> <label for="MinAge" class="sublabel" > Minimum Age:</label>
<div class="errorGroup">
<span>
<input id="MinAge" name="MinAge" type="text" value="<?php echo((isset($_GET["MinAge"])?$_GET["MinAge"]:"")); ?>" class="formTextfield_Medium" tabindex="6">
</span>
</div>
</div>

Sign in to reply to this post

Jason ByrnesWebAssist

I have logged a bug for this in our system so it can be corrected in a future update.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...