VbScript to Close window

Hi,

I actually have a close button, where when i click, the window should close. However, this is what i have:

<INPUT type="submit" value="Close" name=Submit onclick="window.close()">

but it gives me a popup message, which i DO NO want.

Please advice.

GurnainAsked:
Who is Participating?
 
David H.H.LeeCommented:
Gurnain,
I also face the same problems. You should try this to avoid the annoying pop-up message before close the window:
Eg:
<INPUT type="submit" value="Close" name=Submit onclick="javascript:closeWin()">

<script language="javascript">
function closeWin()
{
  window.opener=self;
  window.close;
}
</script>

Regards
x_com
0
 
GurnainAuthor Commented:
x_com,

I think, i have been working with little thing for a long time. However, it still doesn't close my window.

Any suggestions.
0
 
GurnainAuthor Commented:
x_com,

I got it. I was missing the brackets: window.close()

Thanks.
0
 
David H.H.LeeCommented:
you're welcome, Gurnain

Regards
x_com
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.