Jump to content

RussellParker

Members
  • Content Count

    10
  • Joined

  • Last visited

  1. Well.... As I suspected I was being a dolt. I had an HTML box above the Search Fields giving instructions. It was Value1 and "getElementById()" was not working against it and returning Null. Executing the ".value" method against a Null object was causing the Script to short circuit. Instead of using "Value1_1" and "Value2_1" I changed it to "Value2_1" and "Value3_1" and all was well.
  2. Well.... As I suspected I was being a dolt. I had an HTML box above the Search Fields giving instructions. It was Value1 and "getElementById()" was not working against it and returing Null. Executing the ".value" method against a Null object was causing the Script to short circuit. Instead of using "Value1_1" and "Value2_1" I changed it to "Value2_1" and "Value3_1" and your script works perfectly.
  3. Done. URL sent to you in a PM. Thanks! I did some more testing and I think the heart of my problem is "Value1_1". It does not seem to be accepting that as a valid ElementId since:. var element = document.getElementById("Value1_1"); results in "element" being "null"
  4. Hi Elena, To the best of my knowledge MSSQL does not have a native Median() function that I am aware of. You seem to basically be doing what you need to. Sorting based on the field in question and then going to the middle row and taking that value. If you are still having a problem with this I can mess around with it.
  5. I initially posted a question over in Data Pages and got what looks like a answer which should work. However I am having trouble getting the suggested Java Script to work. From that other Thread... I was looking at this more and wondering if I needed to change the "Value1_1" and "Value2_1" strings to be specific to the Name or ID of the Controls on my Search Page, but I did not see anything which looked like what this might be. Then I found this in the "JavaScript Tips: Caspio Form Elements" help article... Search Forms Text Field/Text Area/Dropdown/Checkbox/Listbox/Hidden:
  6. When using the "Contains" comparison type the basic behavior is useful in many cases, but it can also be problematic. I am wondering if anyone knows of a way to prevent it from parsing what is entered in the Search Field. Here is the issue in more detail. Contains | Does Not Contain Keyword is searched within a text field or a file name field. If multiple keywords are entered in the search field, AND operator is assumed between them. User can also provide a desired operator by entering it in ALL CAPS (reference: http://howto.caspio.com/datapages/reports/search-and-filter-compariso
  7. From the "JS Guide: Caspio Form Elements" there is this: Search Forms Text Field/Text Area/Dropdown/Checkbox/Listbox/Hidden: - ValueX_Y - X is the form element order, which starts at 1 and increments based on the order of the element in the form. - Y is the criteria. It starts at 1 and increments based on the criteria order. It is always 1 if the field has no extra criteria. My question is how does one know what the "Criteria Order" is for the different Element Types? Is this documented somewhere? Thanks, Russ
  8. I was looking at this more and wondering if I needed to change the "Value1_1" and "Value2_1" strings to be specific to the Name or ID of the Controls on my Search Page, but I did not see anything which looked like what thus might be. Then I found this in the "JavaScript Tips: Caspio Form Elements" help article. Search Forms Text Field/Text Area/Dropdown/Checkbox/Listbox/Hidden: - ValueX_Y - X is the form element order, which starts at 1 and increments based on the order of the element in the form. - Y is the criteria. It starts at 1 and
  9. Thank you! Unfortunately I tried you code, but I could not get it to work. With a little pruning I was able to get it to reject everything though, so at least I know I am putting the code in the proper place. ============================================ <SCRIPT LANGUAGE="JavaScript"> function check() { var first = ""; var second = ""; if (( first.length === 0) & ( second.length === 0)) { window.alert("Please enter a value in a field"); return false; } } document.getElementById("searchID").onclick=check; </SCRIPT> ==========
  10. I have built a "Search and Report" data page with several fields available for search added under "Configure Search Fields". Each of the fields has a minimum number of characters and is a "Contains" match. This works perfectly if data is entered in any of them. The problem is that if no data is entered in ANY of the Search Fields it brings back the entire data set. I do not want to make any specific field required, I just one at least one of the Search Fields to have had a value entered to search for. Said another way I want to disallow the "All Blanks" case. Any thoughts? Thanks is Adv
×
×
  • Create New...