1
<span class="description">
3
<div class="descriptionheading">Overview</div>
5
The resource search is a variation on a classical search form. A number of optional search terms are entered and a result is retrieved based on those parameters.
7
<div class="descriptionheading">searchResources</div>
8
The function called <span class="interestingdescription">searchResources</span> is executed by the keyup and onchange events for the text boxes in the form.
9
Events connected to text boxes are suitable for this type of application since attaching code to those events allows the capture of text written
10
into a dialog box while the user keeps typing.<br>
11
The search terms are collected from the form and passed directly to the api. The
15
<div class="descriptionheading">showResources</div>
17
The other function <span class="interestingdescription">showResources</span> is nearly identical to the result function of the previous example <a href='AjaxDemoApp2_getCustomerBookings.php'>getCustomerBookings</a>.
19
<br><br><div class="descriptionheading">getResources</div>
21
The <span class="interestingdescription">booking/getresources_XML.php</span> performs a search using a set of search terms.
22
"None" is given, that search term is ignored. <br> The three first terms i.e. name, location and company use a logical or if more than one term is given.
23
The full text search works in isolation from the other terms.
25
<br><br><div class='exampleheading'>Call Example:<br><br>
26
<pre class="codeexample">
29
url: 'booking/getresources_XML.php',
30
data: { name: escape(document.getElementById("resName").value),
31
location: escape(document.getElementById("resLocation").value),
32
company: escape(document.getElementById("resCompany").value),
33
fulltext: escape(document.getElementById("resFulltext").value) },
34
success: showResources
41
<br><div class='exampleheading'>Returned Data Example:<br>
42
<pre><span class="codeexample">
47
company='Sunside Hotels'