jflash
Member
I redirect one form with 'Append jump url with data' option to another. Now i want to read data from URL to find show or hide element. URL looks like:
When 12tulem___paabut_a value is 0 i want to hide element:
$('12sessioonid___liiga').getParent().getParent().hide();
I tried three different codes i found on internet, but no one work. If i put '$('12sessioonid___liiga').getParent().getParent().hide();' in element javascript onload action, it hides the element, so that is correct...
First code. I use QueryData javascript and call it from /components/com_fabrik/js/formnumber.js and it is included. My code in javascript onload action:
Second code:
Third code:
HTML:
http://www.mypage.eu/index.php/vali-mang-ja-suuna?12tulem___valimang[value]=2&12tulem___kasutaja[value]=46&12tulem___nimo_a=0&12tulem___hausenberg_a=0&12tulem___lukjanov_a=0&12tulem___paabut_a=0
$('12sessioonid___liiga').getParent().getParent().hide();
I tried three different codes i found on internet, but no one work. If i put '$('12sessioonid___liiga').getParent().getParent().hide();' in element javascript onload action, it hides the element, so that is correct...
First code. I use QueryData javascript and call it from /components/com_fabrik/js/formnumber.js and it is included. My code in javascript onload action:
Code:
var getData = new QueryData();
if ('12tulem___paabut_a' in getData){
if (getData.12tulem___paabut_a == '0'){
$('12sessioonid___liiga').getParent().getParent().hide();
}
else {
}
}
Code:
window.params = function(){
var params = {};
var param_array = window.location.href.split('?')[1].split('&');
for(var i in param_array){
x = param_array[i].split('=');
params[x[0]] = x[1];
}
return params;
}();
if(window.params.12tulem___paabut_a == 0) {
$('12sessioonid___liiga').getParent().getParent().hide();
}
Code:
function $_GET(q,s) {
s = (s) ? s : window.location.search;
var re = new RegExp('&'+q+'=([^&]*)','i');
return (s=s.replace(/^\?/,'&').match(re)) ?s=s[1] :s='';
}
var value = $_GET('12tulem___paabut_a');
if(window.params.12tulem___paabut_a == 0) {
$('12sessioonid___liiga').getParent().getParent().hide();
}