VERY URGENT:List Box Searching instead of text type

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

Subject: VERY URGENT:List Box Searching instead of text type

change your call to doSearch(this.form.Querys) to:

var selObj = window.document.forms[0].Querys;

var index = selObj.selectedIndex;

var selectedValue = selObj.options[index].text;

doSearch(selectedValue);

Subject: RE: VERY URGENT:List Box Searching instead of text type

Hello Paul, well I have done as u said .I entered those 4 lines told by you on the “Go” button “OnClick”…but still it’s not working .It is not taking any value from the listbox.It is showing the message that "Please enter something to search.I make the second field Querys as listbox and there are 4 or 5 choices.

Can u tell me how to proceed.

Thanx for help.

Kanishka

Subject: RE: VERY URGENT:List Box Searching instead of text type

the code I gave should work just fine. You can test by creating a form with just one field named Querys (type DialogList with 1 2 and 3 as its selection list). Place a button next to it with code I gave you. Test in browser and tt will display what is selected in the Querys field.

The only thing I can think of as to why it’s not working for you is that maybe you have more than one HTML form defined in your notes form design?

Post all your code for the button along with some more detail about your form/field design and I’ll see if I can help further.

Subject: RE: VERY URGENT:List Box Searching instead of text type

Hi Paul, see what I need is that

There is a menu and on one option from that menu I will open a form on which there is a search box of list type option i.e field type is of ListBox type not the DialogList…

Now I want that that user can select a choice from that list and when he enter the “Go” Button then the particular view or form will get open.

eg:

Search By: Field ListBox,Content- By Project Name,By Client Name,By Technolgies Used and so on…and then a Button.

This what I need .

There should be some coding like if choice 1 is selected then this form will open ,If choice 2 then some other form .

This is needed .

I need the solution it’s urgent for me .and I tried as u said but still it’s not working

Subject: RE: VERY URGENT:List Box Searching instead of text type

You didn’t have to explain what you need. I understand what it is that you are trying to accomplish.

The code I posted will work regardless of whether the field type in the designer is Dialog List or List Box.

Please post the code for your button along with any other related javascript code.

Subject: RE: VERY URGENT:List Box Searching instead of text type

hello paul, see on this forum page there is a Browse by option in the right side below search this forum.

I want to do something like this …either this way or with Go button.

getting wat i want to do.

thanx for ur help

kanishka

Subject: RE: VERY URGENT:List Box Searching instead of text type

hello paul, see on this forum page there is a Browse by option in the right side below search this forum.

I want to do something like this …either this way or with Go button.

getting wat i want to do.

thanx for ur help

kanishka