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.

house search using maximum and minimum price

Featured Replies

I want to create a search page. On this page I want people to select the minimum price they want to pay for a house and the maximum price. (using to value lists). The results have to be the houses that have a price in between these min. an max price.

In the database i have fields of adres and price for the houses. I am using fm4.1

Any one got any sollutions?

You can use in search the simple FM way like value between 100000...1000000

Try this:

if a form has more than one input for the the same field, Web Companion joins them all up when the form is submitted.

So put a text input for houiseprice marked on the form as being "lowest price" then a hidden input with "..." then another input field marked on the form as "highest price" and hopefully when submitted FMP will see "$$$...$$$" which should work.

  • Author

That seems to work nicely. but it creates a different problem.

Now it is possible to select a minimum price that is higher than the maximum price (or max lower than minimum)!!! And this is incorrect!

How can i fix this problem?

Any one know a javascript that can validate that the minimum price is lower than the maximum price? I am using value list to select the min and max price.

Paste this into an html editor and try it out! The value attribute doesn't work for popups/dropdowns with netscape (selectedIndex) but does work for text fields

This will stop the submision of the form and return with the offending textbox selected

It's very simple and should start you on your way to playing with JS (i've made it so you will have to change some things it does work though!)

I hope this gets you going

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<script language="JAVASCRIPT"><!--

function dodgyPrice(priceForm) {

if (priceForm.textlowvaluename.value >= priceForm.texthighvaluename.value){alert("bunch of arse the lower price is higher than the higher one!!!")

priceForm.textlowvaluename.focus()

priceForm.textlowvaluename.select()

return false

}

}

//-->

</script>

<body bgcolor="#FFFFFF">

<form name="priceForm" action="do it" method="Post" onsubmit="return dodgyPrice(priceForm)">

low price

<input type="text" name="textlowvaluename" value="4">

high price

<input type="text" name="texthighvaluename" value="1">

<input type=submit name="submit" value="hmmmm"></form></body>

</html>

Have a go with this one

scratchmalogicalwax

<html>

<head>

<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">

<title>Untitled Document</title>

</head>

<script language="JAVASCRIPT"><!--

function dodgyPrice(priceForm) {

if (priceForm.poplowvaluename.selectedIndex >= priceForm.pophighvaluename.selectedIndex){alert("bunch of arse the lower price is higher than the higher one!!!")

priceForm.poplowvaluename.focus()

return false

}

}

//-->

</script>

<body bgcolor="white">

<form name="priceForm" action="file:///Macintosh/Temporary%20Items/do it" method="Post" onsubmit="return dodgyPrice(priceForm)">

low price <select name="poplowvaluename" size="1">

<option value="1000">1000

<option value="2000">2000

<option value="3000">3000

</select><input type="hidden" name="dots" value="...."> high price <select size="1" name="pophighvaluename">

<option value="1000">1000

<option value="2000">2000

<option value="3000">3000

</select><input type="submit" name="submit" value="hmmmm">

</form>

</body>

</html>

  • Author

Thx for ur help, but i am still not able to get it going the way i want it.

I want to select the min_price and max_price (or type it in textfields).

then the field price should be like this:

"min_price...max_price". THis way all the houses should be find within the range. But i want to be able to also search on province and city.

If the form is filled in incorretcly i want to stop submitting and showing the alert message!!!

Have a go with this.....you have to change names of fields to mach those in your database and add some more but the value....value thing you wanted is there.

You don't have to do it all on one page though you could show them all the houses in their price range and then let them focus in...anyway I hope it helps.

Scratch

NB You can do this with dropdowns but it's a pain because netscape doesn't recognise the value attribute of dropdowns (returns NULL) it uses selectedIndex which is useless when your trying to move the value!

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<script language="JAVASCRIPT"><!--

function dodgyPrice(priceForm) {

if (priceForm.textlowvaluename.value >= priceForm.texthighvaluename.value){alert("bunch of arse the lower price is higher than the higher one!!!")

priceForm.textlowvaluename.focus()

priceForm.textlowvaluename.select()

return false

}

}

//-->

</script>

<body bgcolor="#FFFFFF">

<form name="priceForm" method="Post" >

low price

<input type="text" name="textlowvaluename" value="4">

<input type="hidden" name="dots" value="....">

high price

<input type="text" name="texthighvaluename" value="1">

</form>

<!--two forms to stop you searching on the values and field names of the first-->

<form name="priceForm1" action="FMPro" method="Post" onsubmit="return dodgyPrice(priceForm)">

<!--change queryfield type to hidden it is text to show you it working you also want to add your location and whatever fields here adding a -LOP "AND" hidden field

before all the fields your searching on and an -OP "eq" field before EACH of the search fields -->

<input type="text" name="queryfield">

<!--change the submit name to name="-Find" (i'm assuming your using WC not lasso & WC) don't worry about the queryfield value not appering to change when you click submit ..it does, click back and you'll see-->

<input type="submit" name="button" value="hmmmm" onClick="priceForm1.queryfield.value=priceForm.textlowvaluename.value + priceForm.dots.value + priceForm.texthighvaluename.value;">

</form>

</body>

</html>

  • Author

THanx that really got me going again!!!

Pitty though i can't use select boxes but it works nicely!

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.