View Full Version : Would like help with getting a window.open function to work!

03-02-2012, 12:29 PM
I am making a website where when the user clicks on a hyperlink in a list, a new browser window opens and displays a file called "faqs.html".

The code for my function so far is:

function ValidateWebDetails

To test whether the function actually worked, I first attached it to a button with this code:

<form method="post">
<input type="button" value="Go To FAQS" onClick="ValidateWebDetails()"

However, when I went to test the button, when I clicked on it, no new window was displayed and I was wondering what I could do to fix the problem.

Any help is appreciated! :D

03-02-2012, 03:34 PM
I think you need a semi-colon (;) on your button line and, definitely, a closing gtreater-than (>) sign:

<input type="button" value="Go To FAQS" onClick="ValidateWebDetails();">

Also, I usually specify a variable to hold a reference to the pop-up so that I can reference it later if I wish:


You may need a name for the pop-up window, but I'm not positive about that:


03-02-2012, 04:14 PM
As I see you have two problems.
1- You need to close the tag input

<input type="button" value="Go To FAQS" onClick="ValidateWebDetails()" />

2- When you declare a javascript function you need to add the parenthesis like this

function ValidateWebDetails()