well, heres something to try, im not sure if it works.

when i make popup windows i have a button where onClick="window.close();".
So window.close() is what you want to do if the requirements are not met.
what id do is something like this (lets say the name of the <input
type=text> field is called Name).

<@ifempty expr="<@arg Name>">
<body onLoad="window.close();">
<@else>
<meta http-equiv="refresh"
content="0;url=http://www.somewhere.com/something.taf";>
</@if>

A cleaner way i think would be to check before they submit the form, but
then you have to assume all your clients have java script enabled browsers
which may be too big of an assumption.  Heres some code to do that anyways
though:

<SCRIPT language=javascript>
<!--
function ValidateForm()
{
  if(MyForm.Name.value=="")
    window.close();
  else
  {
    MyForm.action="http://www.somewhere.com/something.taf";;
    MyForm.submit();
  }
}
-->
</SCRIPT>

<form method=post name=MyForm action="">

Name<input type=text name=Name value="">

<input type=button value="OK" onClick="ValidateForm();">

</form>

Hope this helps,
Atrix

----- Original Message -----
From: "rich Jasinski" <[EMAIL PROTECTED]>
To: "Multiple recipients of list witango-talk" <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 1:24 PM
Subject: Witango-Talk: Closing a browser window without user clicking


> Is there a way to close a browser window without the user clicking a
button?
> I have a taf that looks at a table and if there is a value in a field it
> does a redirect to a page. If the value is not there I want to close the
> browser.
>
> rich
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
>                 with unsubscribe witango-talk in the message body
>

________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to