FoxSecrets
Well-known member
I implemented a toggle form, it works on desktop view but not in mobile view.
I can see the function working in mobile view however do not toggle the form.
Is there any special setup to run javascript in Xenforo mobile view?
	
	
	
		

	
	
	
		
	
	
	
		
				
			I can see the function working in mobile view however do not toggle the form.
Is there any special setup to run javascript in Xenforo mobile view?
		Code:
	
	  function toggleForm(event) {
    var form = document.getElementById('search-form');
    form.classList.toggle('hidden-form');
    console.log(form.classList);
  }
	
		Code:
	
	<div class="block-container">
    <div onclick="toggleForm()" id="toggleButton">
      <h3 class="block-header">{{ phrase('search') }}</h3>
    </div>
    <xf:form action="{{ link('xxxxx') }}" id="search-form" class="block hidden-form">
      My form
    </xf:form>
  </div>
	
		Code:
	
	.hidden-form {
    display: none;
}