Jump to content

JayGuarnieri

Members
  • Content Count

    21
  • Joined

  • Last visited

Posts posted by JayGuarnieri

  1. Hi Jan,

     

    thanks for coming back to me. Just to clarify when you say "Any" field, do you mean when the user makes any selection at all or when they make the selction "Any". For the record, no matter what selection (or multiple selections) they make in the list box, an empty value is passed (or nothing is passed). Using "return false;" I confirmed that the fields Virtual9 and 11 had no value (not even "") but I'm not sure what you mean by 

     

    You can enter the correct value to the "Any" item, it will be like:

     

    a1" OR "a2" OR "a3" OR "a4" OR "a5

  2. Can't figure out what would cause this problem. In the code below cbParamVirtual7 ,8 and 10 field values are all being passed to a new datapage as I'd expect. 9 and 11 are passing no values. I've ruled out the results datapage accepting the values as I can input the parameters manually using the preview option and get the desired result. I've gone over and over this and cannot find anything wrong. Can someone give me pointers as to a possible cause or where to go next?
     

    <SCRIPT LANGUAGE="JavaScript">
     /* "fieldName" is the variable name for the listbox type form element field. */
       var fieldName1 = "cbParamVirtual1";
       var fieldName2 = "cbParamVirtual2";
       var fieldName3 = "cbParamVirtual3";
       var fieldName4 = "cbParamVirtual4";
       var fieldName5 = "cbParamVirtual5"; 
       var x1=document.getElementsByName(fieldName1);
       var x2=document.getElementsByName(fieldName2);
       var x3=document.getElementsByName(fieldName3);
       var x4=document.getElementsByName(fieldName4);
       var x5=document.getElementsByName(fieldName5);
       x1[0].multiple=true;
       x2[0].multiple=true;
       x3[0].multiple=true;
       x4[0].multiple=true;
       x5[0].multiple=true;
    </SCRIPT>
    <script type="text/javascript">
       var fieldName1 = "cbParamVirtual1";
       var fieldName2 = "cbParamVirtual2";
       var fieldName3 = "cbParamVirtual3";
       var fieldName4 = "cbParamVirtual4";
       var fieldName5 = "cbParamVirtual5";
    
    
       var x1=document.getElementsByName(fieldName1);
       x1[0].multiple=true;
       var x2=document.getElementsByName(fieldName2);
       x2[0].multiple=true;
       var x3=document.getElementsByName(fieldName3);
       x3[0].multiple=true;
       var x4=document.getElementsByName(fieldName4);
       x4[0].multiple=true;
       var x5=document.getElementsByName(fieldName5);
       x5[0].multiple=true;
       
    function splitAndParse()
    {
       var result1 = "";
       var result2 = "";
       var result3 = "";
       var result4 = "";
       var result5 = "";
       var cleanResult1 = "";
       var cleanResult2 = "";
       var cleanResult3 = "";
       var cleanResult4 = "";
       var cleanResult5 = "";
    
    
    for (var i = 0; i < x1[0].length; i++) { 
    if (x1[0].options[i].selected) { 
    result1 += "\""+x1[0].options[i].value+"\"" + " OR " ; }} 
    if (x1[0].length > 4) { cleanResult1 = result1.substring(0,(result1.length-4)); }
    document.getElementById("cbParamVirtual7").value = cleanResult1;
    
    
    for (var i = 0; i < x2[0].length; i++) { 
    if (x2[0].options[i].selected) { 
    result2 += "\""+x2[0].options[i].value+"\"" + " OR " ; }} 
    if (x2[0].length > 4) { cleanResult2 = result2.substring(0,(result2.length-4)); }
    document.getElementById("cbParamVirtual8").value = cleanResult2;
    
    
    for (var i = 0; i < x3[0].length; i++) { 
    if (x3[0].options[i].selected) { 
    result3 += "\""+x3[0].options[i].value+"\"" + " OR " ; }} 
    if (x3[0].length > 4) { cleanResult3 = result3.substring(0,(result3.length-4)); }
    document.getElementById("cbParamVirtual9").value = cleanResult3;
    
    
    for (var i = 0; i < x4[0].length; i++) { 
    if (x4[0].options[i].selected) { 
    result4 += "\""+x4[0].options[i].value+"\"" + " OR " ; }} 
    if (x4[0].length > 4) { cleanResult4 = result4.substring(0,(result4.length-4)); }
    document.getElementById("cbParamVirtual10").value = cleanResult4;
    
    
    for (var i = 0; i < x5[0].length; i++) { 
    if (x5[0].options[i].selected) { 
    result5 += "\""+x5[0].options[i].value+"\"" + " OR " ; }} 
    if (x5[0].length > 4) { cleanResult5 = result5.substring(0,(result5.length-4)); }
    document.getElementById("cbParamVirtual11").value = cleanResult5;
    
    
    }
    
    
    document.getElementById("caspioform").onsubmit=splitAndParse;
    </script>
  3. I think I have code blindness  :blink: . Can you spot anything obvious as to why the second parameter isn't returning any records even if a single selection is made? The first field works like a charm.

     

    <script type="text/javascript">

       var fieldName1 = "cbParamVirtual1";

       var fieldName2 = "cbParamVirtual2";

       var x1=document.getElementsByName(fieldName1);

       var x2=document.getElementsByName(fieldName2);

      x1[0].multiple=true;

      x2[0].multiple=true;

       

    function splitAndParse()

    {

    var result1 = "";

    var result2 = "";

    var cleanResult1 = "";

    var cleanResult2 = "";

     

    for (var i = 0; i < x1[0].length; i++) { 

    if (x1[0].options.selected) { 

    result1 += "\""+x1[0].options.value+"\"" + " OR " ; }} 

    if (x1[0].length > 4) { cleanResult1 = result1.substring(0,(result1.length-4)); }

    document.getElementById("cbParamVirtual7").value = cleanResult1;

     

    for (var i = 0; i < x2[0].length; i++) { 

    if (x2[0].options.selected) { 

    result2 += "\""+x1[0].options.value+"\"" + " OR " ; }} 

    if (x2[0].length > 4) { cleanResult2 = result2.substring(0,(result2.length-4)); }

    document.getElementById("cbParamVirtual8").value = cleanResult2;

     

    }

     

    document.getElementById("caspioform").onsubmit=splitAndParse;

    </script>

  4. Hi, 

     

    I'm using a submission form as a search form (auto submit with virtual fields) but cannot get the multi-select to work. The only reference I could find to it was here. 

     

    http://forums.caspio.com/index.php/topic/3148-js-select-multiple-values-from-a-listbox-in-a-webform/?hl=%2Bselect+%2Bmultiple+%2Bvalues+%2Bfrom+%2Blistbox+%2Bwebform#entry9870

     

    I've followed these simple instructions but still can't multi-select. Not sure where I can be going wrong.

     

    Any help appreciated.

    Thanks

  5. Okay, so I've migrated my site to wordpress. The site has two distinct functions. The database search using caspio for a set of products and the wordpress posts with information relating to those products. What would be really good is if I can integrate the two.

     

    So the user drills down to a details page and the related wordpress category posts are displayed alongside. My question is how do I pass the relevant caspio parameter to wordpress? If it can be done?

     

    Many thanks.

×
×
  • Create New...