I'm really new to Caspio and I've been struggling with a situation.
A have a search form with a Radio button which contain 3 boxes (Company | Constructions | Massive Construction). I'd like to hide certain columns based on the selection of this radio button.
For example: If I select Company and click "search", I'd like to hide columns 4,5,7 and 8 of the results page and if I select Constructions to hide columns 9,10,11 and 12.
I tried the following code inserted to the Header:
I thought that maybe the problem was the communication between the Search part of the form and the result (they are in the same DataPage).
So I tried something really simple to see if I could just display the results I'm getting from document.getElementsByName("Value1_1") and I get nothing.
I tried inserting the following code in the Header, as well as in the Footer and only got "Undefined" as result:
<buttononclick="myFunction()">Valor</button><script>var test= document.getElementById("Value1_10").value
var test2=document.getElementById("Value1_11").value
var test3=document.getElementById("Value1_12").value
var test4=document.getElementById("Value1_1").value
if(document.getElementById("Value1_10").checked){var test5="a"}if(document.getElementById("Value1_11").checked){var test6="a"}if(document.getElementById("Value1_12").checked){var test7="a"}if(document.getElementById("Value1_1").checked){var test8="a"}function myFunction(){
alert(test);
alert(test2);
alert(test3);
alert(test4);
alert(test5);
alert(test6);
alert(test7);
alert(test8);}</script>
I really have no idea what I'm doing wrong. I checked the html code of the Search Form and the Radio Button is really named as "Value1_1":
For example: <input type="radio" name="Value1_1" id="Value1_10_323d54705b4c9c" value="Company">
I also tried changing getElementById to ByName without success either.
I would also like to have the first field (Company) of the Radio button selected when I open the form and this first search already performed (displaying the results for the Company search). Is there a way to do it?
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.
Question
DiogoBem
Hi,
I'm really new to Caspio and I've been struggling with a situation.
A have a search form with a Radio button which contain 3 boxes (Company | Constructions | Massive Construction). I'd like to hide certain columns based on the selection of this radio button.
For example: If I select Company and click "search", I'd like to hide columns 4,5,7 and 8 of the results page and if I select Constructions to hide columns 9,10,11 and 12.
I tried the following code inserted to the Header:
and I added "</div> to the Footer
I thought that maybe the problem was the communication between the Search part of the form and the result (they are in the same DataPage).
So I tried something really simple to see if I could just display the results I'm getting from document.getElementsByName("Value1_1") and I get nothing.
I tried inserting the following code in the Header, as well as in the Footer and only got "Undefined" as result:
I really have no idea what I'm doing wrong. I checked the html code of the Search Form and the Radio Button is really named as "Value1_1":
For example: <input type="radio" name="Value1_1" id="Value1_10_323d54705b4c9c" value="Company">
I also tried changing getElementById to ByName without success either.
I would also like to have the first field (Company) of the Radio button selected when I open the form and this first search already performed (displaying the results for the Company search). Is there a way to do it?
Any help would be tremendously appreciated.
Thanks
Link to comment
Share on other sites
4 answers to this question
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.