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.

Can you search multiple fields?

Featured Replies

I have looked around but I can't find the answer I am looking for.

I want to have a person search several fields in my database but only enter one text string. I would like to have radio buttons saying for example "search answer only", "search question only", "search both q & a". Can anyone help me figure this out?

Thanks.

quote:

Originally posted by texaschick:

I have looked around but I can't find the answer I am looking for.

I want to have a person search several fields in my database but only enter one text string. I would like to have radio buttons saying for example "search answer only", "search question only", "search both q & a". Can anyone help me figure this out?

Thanks.

texaschick,

I would create calculated fields in my database. These fields only purpose would be to combine the data from several different fields and display them. For example I could create a field called "Answer Calc", set it as calculation and define it as such:- Answer1&" "&Answer2&" "&Answer3

where "Answer1", "Answer2", "Answer3" are different fields in the database. I would set the result as text or whatever (depending on the data in the answer fields). Finally in the search page I would let them search this field.

Hope this helps.

Here is the HTML page with the javascript to do what you want:

<html>

<head>

<script>

function setChoice(choice){

switch(choice){

case (0) ???

document.yourForm.answer.value="";

document.yourForm.question.value="";

break;

case (1) :

document.yourForm.answer.value=document.yourForm.searchText.value;

document.yourForm.question.value="";

break;

case (2) :

document.yourForm.answer.value="";

document.yourForm.question.value=document.yourForm.searchText.value;

break;

case (3) :

document.yourForm.answer.value=document.yourForm.searchText.value;

document.yourForm.question.value=document.yourForm.searchText.value;

}

}

</script>

</head>

<body>

<form name="yourForm">

Type your search criteria here: <input type="text" name="searchText" value="" size=20>

and then

<select NAME="choice" onChange="setChoice(this.selectedIndex)">

<option selected>--Select search option-- 

<option>search answer only 

<option>search question only 

<option>search both 

</select>

<br>

Answer: <input type="text" name="answer" value="" size=20> (this would be a hidden field)

<br>

Question: <input type="text" name="question" value="" size=20> (this would be a hidden field)

<br>

<INPUT TYPE="Reset" VALUE="Clear this form">

</form>

</body>

</html>

  • Author

dspires,

Thanks so much. That is exactly what I was looking for.

Create an account or sign in to comment

Important Information

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

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.