DMXzone Database Connector PHP Support Product Page

Solved

Form filter not working

Reported 09 Oct 2013 23:55:39
1
has this problem
09 Oct 2013 23:55:39 Eric Jennings posted:
I have setup a form variable search and it does not filter the results.
The Database Source Testing shows the correct results and the default results show on the page. Once I enter a search variable then it refreshes the data, but it does not filter the results.

the code on the page:

<form name="form1" method="post" action="">
  <input type="text" name="search" id="search">
  <input name="submit" type="submit" id="submit" onClick="dmxDataBindingsAction('refresh','Property',{'url':'dmxDatabaseSources/PropertiesListing.php?search={{$FORM.search}}&amp;limit=25'})" value="Submit">
</form>
<p>&nbsp;</p>

<div class="repeat1" data-binding-id="repeat1" data-binding-repeat="{{Property.data}}">
  <p><img src="uploads/{{MainPhoto}}" width="250" data-binding-src="{{MainPhoto}}" /></p>
  <p>searchtype: {{SearchType}}</p>
  <p>propertytype: {{PropertyTYPE}}</p>
  <p>{{Price}}</p>
  <p>District: {{District}}</p>
  <p>Area: {{Area}}</p>
  <p>Country: {{Country}}</p>
  <p>Bedrooms: {{Bedrooms}}</p>
  <p>Bathrooms: {{Bathrooms}}</p>
</div>


What am I missing and what other info do you need?

Replies

Replied 10 Oct 2013 03:54:06
10 Oct 2013 03:54:06 Eric Jennings replied:
Also, when I try to test this on the production, I just a blank page.

thx
Eric
Replied 10 Oct 2013 09:31:46
10 Oct 2013 09:31:46 Teodor Kuduschiev replied:
Hello Eric
Please provide a link to your page.
Replied 10 Oct 2013 14:15:06
10 Oct 2013 14:15:06 Teodor Kuduschiev replied:
Please attach any of this pages to an email to:
Replied 10 Oct 2013 14:19:18
10 Oct 2013 14:19:18 Eric Jennings replied:
On the way.

thx
Eric
Replied 10 Oct 2013 15:11:08
10 Oct 2013 15:11:08 Eric Jennings replied:
Teodor,

Did you get my email?

thx
Eric
Replied 10 Oct 2013 15:14:43
10 Oct 2013 15:14:43 Teodor Kuduschiev replied:
Are you sure your files are uploaded to the server?
Even the www.rentparisapartmentonline.com/test/ScriptLibrary/jquery-latest.pack.js file returns an empty result - there is something wrong there.
Replied 10 Oct 2013 15:19:10
10 Oct 2013 15:19:10 Eric Jennings replied:
Yes, but I think that is a server issue I need to resolve. My first step was to get it working correctly on my local setup.

Do the pages look correct to you?
Replied 10 Oct 2013 15:27:24
10 Oct 2013 15:27:24 Teodor Kuduschiev replied:
Yes, the code generated in the test.html looks good to me for using the search form.
The search.html is also okay to be used with a URL variable.
Replied 10 Oct 2013 15:37:15
10 Oct 2013 15:37:15 Eric Jennings replied:
Okay, I have it loaded to the server.

Go here:
www.rentparisapartmentonline.com/test/test.html

And type in Italy for the form search. It returns the default properties and none of the Italy properties (there are several Italy properties in the database).

I want to basically build this:
www.dmxzone.com/demo/php/HTML5DataBindings/LuxuryYachts/index.html

thx
Eric
Replied 10 Oct 2013 15:43:10
10 Oct 2013 15:43:10 Teodor Kuduschiev replied:
Please remove the submit property from the button You don't need to submit the form.
It should be type="button"

Actually the form automatically refreshes the content as soon as you click out of the search field. That's why you need this "dummy button", that does nothing when it is clicked.
Replied 10 Oct 2013 16:03:15
10 Oct 2013 16:03:15 Eric Jennings replied:
Done. I added a record count, but it is still not filtering.

The filter condition is using "Contains".
Replied 10 Oct 2013 16:05:48
10 Oct 2013 16:05:48 Teodor Kuduschiev replied:
Your

<input id="button" type="submit" ... 


Should be
<input id="button" type="button" ... 


As now it only submits the form, which clears the search phrase.
Replied 10 Oct 2013 16:07:17
10 Oct 2013 16:07:17 Eric Jennings replied:
Got it
It works now, thanks!!
Replied 10 Oct 2013 16:09:37
10 Oct 2013 16:09:37 Eric Jennings replied:
Is there a tutorial for this showcase:
www.dmxzone.com/demo/php/HTML5DataBindings/LuxuryYachts/index.html

This is exactly what I need to build.

thx
Eric
Replied 10 Oct 2013 16:09:51
10 Oct 2013 16:09:51 Teodor Kuduschiev replied:
You're welcome. You can also use a simple button:
 <button type="button">Click Me!</button> 

Replied 10 Oct 2013 16:11:25
10 Oct 2013 16:11:25 Teodor Kuduschiev replied:
Unfortunately there is no any tutorial but it is the same and there is no need of a button as when the value is changed in the select field, the data is automatically refreshed.
Replied 10 Oct 2013 16:13:42
10 Oct 2013 16:13:42 Eric Jennings replied:
Got it. I can just replace the text boxes with select list. I don't even need a form correct?

thx
Eric
Replied 10 Oct 2013 16:20:21
10 Oct 2013 16:20:21 Teodor Kuduschiev replied:
Yes, exactly and no Form is needed.
Replied 10 Oct 2013 16:21:21
10 Oct 2013 16:21:21 Eric Jennings replied:
Thanks Teodor!!

Reply to this topic