Hello frens, I want to make the search box but with the list option where user can select one of those item from the list box and then do the search on the basis of that option from the list box.
I have made a subform for search in which I used 2 fields of type text.
One field is of 'Computed for display 'whose name is "Query" it's default value is "" and another field is of editable type whose name is "Querys" and default value is Query.
Then there is a Button "GO" on the click of whom I called the function doSearch(this.form.Querys)
and on the form Javascript event the coding is
function openDbRelativeURL( url, target )
{ //Check we have a target window;
target = (target == null ) ? window : target;
//Work out the path of the database;
path = location.pathname.split('.nsf')[0] + '.nsf/';
target.location.href = path + url;
}
function doSearch ( s )
{
var regExp1 = /\bfield\b/;
var regExp2 = /[(,),<,>,\[,\]]/;
var str = s.value; if ( str == "" ){
alert("Please be sure to enter something to search for.");
s.focus();
}
else
{
if ( typeof regExp1.source != 'undefined' ) //supports regular expression testing
if ( regExp1.test( str ) || regExp2.test( str ) )
{
var alrt = "Please note that you can not include:";
alrt += "\n\nThe reserved word 'field'\nthe characters [, ], (, ), < or >";
alrt += "\n\nin your search query!\n\nIf you are confident that you know";
alrt += "\nwhat you are doing, then you can\nmanually produce the URL required."
s.focus();
return alert( alrt );
}
openDbRelativeURL(“PINDetails?SearchView&Query=” + escape( str ) + “&start=1&count=100”);
}
}
This is the coding for the search form in which i make a search on the basis of the text entered by the user but now i want the search on the basis of option selected from the list.Can anyone tell me how to do this?
I will be highly grateful. it’s very urgent Please tell me .
Thanx in advance
Kanishka