Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

Javascript onclick not working - What should I do?

Asked by Ricslator Oct 13, 2022 908 views 1 answer
Share

About this question

I have a Sharepoint2010 site and am trying to execute a Javascript code to create some drop down selection menus with a GO button at the end. The GO button is supposed to run a function that does a URL redirect via the [removed] command based on the choices in the dropdown. I have this saved in a TXT file then called within a CEWP.

The snippet of code that I believe is having issues is with the function or the button itself.

This is what I have at the moment in a simplified form:

function submitGo(){

[removed] = "www.google.com"

}

<button onclick="submitGo()">Go</button>

But when I load my page and click the GO button it just reloads my sharepoint page and does not perform the redirect. I have tried replacing the function in the command with the [removed] command directly and it does the same thing. I am at a complete loss as to why this is not working.


Your answer

1 Answer

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.