peterhanse Posted February 9, 2016 Report Share Posted February 9, 2016 I want to hide the submitbutton in the header of datapage when eigenaar(owner) and aanmaker(user) are not equal. But i cant get it right. see the code i try too use. regards Peter <input id="Voeg_toe" class="cbSubmitButton1" type="submit" onmouseout="cbButtonHover(this,'cbSubmitButton1');" onmouseover="cbButtonHover(this,'cbSubmitButton1_hover');" value="Voeg toe" name="Voeg_toe" onClick="window.location.href='https://www.test.nl/?s_id=[@s_id]'"><br><br> <SCRIPT LANGUAGE="JavaScript"> var eigenaar='[@s_id]'; var aanmaker='[@authfield:user_tabel_user_id]'; } if (eigenaar!=aanmaker) { document.getElementById("Voeg_toe").style.visibility = 'hidden'; } </script> Quote Link to comment Share on other sites More sharing options...
0 LWSChad Posted February 9, 2016 Report Share Posted February 9, 2016 It looks like you have an extra closed bracket, but also try... 1. Drop dropping in some alerts throughout to see where it's breaking. 2. I recommend style.display = 'none' over style.visibility = 'hidden' <SCRIPT LANGUAGE="JavaScript"> alert('Hi - test1'); var eigenaar='[@s_id]'; alert(eigenaar); var aanmaker='[@authfield:user_tabel_user_id]'; alert(aanmaker); } if (eigenaar!=aanmaker) { alert('Not equal!'); document.getElementById("Voeg_toe").style.visibility = 'hidden'; alert('Visibility set to hidden. Is it hidden?'); } </script> Jan 1 Quote Link to comment Share on other sites More sharing options...
0 peterhanse Posted February 11, 2016 Author Report Share Posted February 11, 2016 Thank you Chad, it was the bracket. LWSChad 1 Quote Link to comment Share on other sites More sharing options...
Question
peterhanse
I want to hide the submitbutton in the header of datapage when eigenaar(owner) and aanmaker(user) are not equal. But i cant get it right.
see the code i try too use. regards Peter
<input id="Voeg_toe" class="cbSubmitButton1" type="submit" onmouseout="cbButtonHover(this,'cbSubmitButton1');" onmouseover="cbButtonHover(this,'cbSubmitButton1_hover');" value="Voeg toe" name="Voeg_toe" onClick="window.location.href='https://www.test.nl/?s_id=[@s_id]'"><br><br>
<SCRIPT LANGUAGE="JavaScript">
var eigenaar='[@s_id]';
var aanmaker='[@authfield:user_tabel_user_id]';
}
if (eigenaar!=aanmaker)
{
document.getElementById("Voeg_toe").style.visibility = 'hidden';
}
</script>
Link to comment
Share on other sites
2 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.