Open survey in a new window

Very often, you will want to have a link on your website that will allow users to partake in a survey. This is very easy to implement, all you need to do is to add an anchor point in your web page. The html code will be as follows.

Take the survey

If you have the html code entered correctly then you will end up with the following. Click  this to see a new browser window open up with the smarterDimensions website in it.

Another thing that you may want to do is to open a window to a specific size and style. To do this it requires a bit more thought and you have to JavaScript. In the example we are going to open up a window when we click a button, this is the basic structure of the JavaScript

window.open('url to open','window name','attribute1,attribute2')

As we can see it is possible to have lots of different attributes at the end of of the function. The possible values for the attributes are

width=100 This determines the width of the window in pixels
height=100 This determines the height of the window in pixels
resizable=yes or no This determines if the user can re-size the window
scrollbars=yes or no This determines if you window has scroll bars or not
toolbar=yes or no This determines if the user has access to the navigation buttons etc
location=yes or no This determines if the location url is visible to the user
directories=yes or no This determines if the other buttons on a browser are visible
status=yes or no This determines if the status bar window should be shown
menubar This determines if the menu options of the browser should be shown
copyhistory This determines if the browser history should be copied to the new window
screenX ** This determines the left position of the window
screenY ** This determines the Top position of the window
left **** This determines the left position of the window
top **** This determines the Top position of the window

** Only works with Netscape 4+                

**** Only works with Internet Explorer 4+               

So what we have to do now is add this code into our web page, here is an example

One thing we should also mention is how to close a window. To do this put a button on your form and add the following code.

     

Leave a Comment

%d bloggers like this: