asked on
// In the head tag...
function Preview2() {
var obj;
obj = document.getElementById("NewTest");
obj.action = 'preview.asp'; //your popup page
//obj.method = 'get'; //or don't use this line if you don't need to change method
obj.target = '_blank';
//obj.target.window.width = '1000'
obj.submit();
}
<!-- In the body. One of several forms-->
<form action="addnew.asp" method="post" name="NewTest" id="NewTest">
<input name="TestTitle" type="text" class="TableBody" id="TestTitle" size="100" maxlength="100" />
<textarea name="TestDescription" cols="100" rows="10" id="TestDescription"></textarea>
<!--And a link to call the preview window-->
<a href="#TestItem" class="TableBodyLink" onclick="Preview2();">Preview...</a>
<!--And a submit button-->
<input name="Submit" type="submit" value="Submit" />
<FORM name="form1" method="POST" action="your_asp.asp" target="_self" onSubmit="javascript: return Preview();">
ASKER
Like this: (haven't tested)
// In the head tag...
function Preview2() {
var obj;
obj = document.getElementById("NewTest");
obj.action = 'preview.asp'; //your popup page
//obj.method = 'get'; //or don't use this line if you don't need to change method
obj.target = '_blank';
//obj.target.window.width = '1000'
obj.submit();
}
function setback() {
var obj;
obj = document.getElementById("NewTest");
obj.action = 'addnew.asp'; //your popup page
obj.target = '_self';
}
<!-- In the body. One of several forms-->
<form action="addnew.asp" method="post" name="NewTest" id="NewTest">
<input name="TestTitle" type="text" class="TableBody" id="TestTitle" size="100" maxlength="100" />
<textarea name="TestDescription" cols="100" rows="10" id="TestDescription"></textarea>
<!--And a link to call the preview window-->
<a href="#TestItem" class="TableBodyLink" onclick="Preview2();">Preview...</a>
<!--And a submit button-->
<input name="Submit" type="submit" value="Submit" onclick="setback()" />
ASKER
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY
obj.action = 'preview.asp'; //your popup page
Change the action back to addnew when you click the submit button.