Jump to content
Sign in to follow this  
Leslie MacNeill

problem finding multiple criteria in form

Recommended Posts

I need to be able to find based on multiple criteria in a form and I'm running into a problem. The user should not be able to proceed if they don't fill in both fields, but the form is going to the action page instead of the error page if they leave either or both fields blank. I've tried adding the -lop "and" and also the fieldname.op "eq" to no avail. I don't have this problem in my inline statements, just the form. Any ideas what's wrong?

hitlist.xsl

Please enter your Make and Model.

Make

Model

Search for Parts

Thanks in advance for your help.

Share this post


Link to post
Share on other sites

In your database, add a calculation field, which is called make_model and concatenates the values in fields make and model.

Add this field in your form, with

Add also

Add a onsubmit="javascript:submitvalues()" call to your form tag

The JavaScript function looks like this:

function submitvalues()

{

var vkey1=document.searchform.make.value;

var vkey2=document.searchform.model.value;

if (vkey1 == "") vkey1="dummy";

if (vkey2 == "") vkey2="dummy";

if (vkey1.indexOf("*") > -1) vkey1="dummy";

if (vkey2.indexOf("*") > -1) vkey2="dummy";

document.searchform.make_model.value=vkey1+vkey2;

return true;

}

This should work and also check for entered * .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

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