|
↑
Forms >>>
Allows you to format the target window of a form from the form's target property. This allows for the use of window properties, variables, and other data manipulation to effect these options.
Add the below code to the <body> section of your page:
<script
language="javascript"
type="text/javascript">
var
myHeight =
200;
var
isResizable =
true;
function
createTarget(form)
{
_target
=
form.target;
_colon
=
_target.indexOf(":");
if(_colon
!=
-1)
{
form.target
=
_target.substring(0,_colon);
form.args
=
_target.substring(_colon+1);
}
else
if(typeof(form.args)=="undefined")
{
form.args
=
"";
}
if(form.args.indexOf("{")!=-1)
{
_args
=
form.args.split("{");
form.args
=
_args[0];
for(var
i =
1;
i <
_args.length;i++)
{
_args[i]
=
_args[i].split("}");
form.args
+=
eval(_args[i][0])
+
_args[i][1];
}
}
form.args
=
form.args.replace(/
/g,"");
_win
=
window.open('',form.target,form.args);
if(typeof(focus)=="function")
_win.focus();
return
true;
}
</script>
<form
action="YOUR-CGI-SCRIPT.CGI"
method=get
target="foobar:width={window.screen.width/2},
height={myHeight},
scrollbars,
{(isResizable)?'resizable':''},
status"
onSubmit="return
createTarget(this);">
<table>
<tr><td
align=right>Name:</td>
<td><input
name=name></td></tr>
<tr><td
align=right>Email:</td>
<td><input
name=email></td></tr>
<tr><td
align=right>Favorite
Color:</td>
<td><input
name=fav_color></td></tr>
<tr><td
align=center
colspan=2><input
type="Submit"></td></tr>
</table>
</form>
|
→ online casino in Canada
|