Bangalore Posted June 26, 2014 Report Share Posted June 26, 2014 On a Search and Report how To Search On Two Predefined Criteria? Quote Link to comment Share on other sites More sharing options...
Jan Posted June 27, 2014 Report Share Posted June 27, 2014 Hello Bangalore, As I understand, you want to search by two criteria and see results that match any criteria (like OR logic)? It is rather easy, if your fields have Yes/No type. 1) Add one more field with Yes/No type to your table (for example, name it "both"). 2) This field is checked if either First field or Second field is checked. 3) Add this field to your Search page as the last field and set the Any item as a default choice. 4) Hide the added field using HTML blocks. 5) Add Header and Footer element to your Search page. 6) To the Footer, add the JavaScript code like: <SCRIPT LANGUAGE="JavaScript"> function two_choices() { var choice1 = document.getElementById("ValueN_10").checked; var choice2 = document.getElementById("ValueM_10").checked; if((choice1)&&(choice2)) { document.getElementById("ValueN_10").checked = false; document.getElementById("ValueN_12").checked = true; document.getElementById("ValueM_10").checked = false; document.getElementById("ValueM_12").checked = true; document.getElementById("ValueZ_12").checked=false; document.getElementById("ValueZ_10").checked=true; } } document.getElementById("caspioform").onsubmit=two_choices; </SCRIPT> where N - is the Professional Transporters form element order, which starts at 1 and increments based on the order of the element in the form; M - is the Professional Transporters form element order; and Z - is the added field form element order. For example, if you have only two fields and added the hidden third field, N will be 1, M will be 2 and Z will be 4 (because HTML block will be the third field). I hope, it helps. Quote Link to comment Share on other sites More sharing options...
Bangalore Posted June 27, 2014 Author Report Share Posted June 27, 2014 Thanks Caspio Ninja, i will try this out and let you know Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.