Jump to content
  • 0

Hide A Submitbutton In The Header.


peterhanse
 Share

Question

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

  • 0

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>

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...