I have this home.js file and I'm trying to collect the values on the
other at "emplist.aspx"
function poponload()
{
testwindow= window.open ("emplist.aspx", "mywindow",
"location=1,status=1,scrollbars=1,width=600,height =600");
testwindow.moveTo(0,0);
}
document.write ("<form action=http://www.espn.com method=post>")
document.write ("<input type=text>")
document.write ("<input type=button value=Search onClick='javascript:
poponload()'>")
document.write ("</form>")
but I don't know how to retrieve the values in the emplist.aspx page.
the page opens but I can't retrieve the values. 6 18076
On Apr 5, 3:40 pm, vnc...@hotmail.com wrote:
I have this home.js file and I'm trying to collect the values on the
other at "emplist.aspx"
function poponload()
{
testwindow= window.open ("emplist.aspx", "mywindow",
"location=1,status=1,scrollbars=1,width=600,height =600");
testwindow.moveTo(0,0);
}
document.write ("<form action=http://www.espn.commethod=post>")
document.write ("<input type=text>")
document.write ("<input type=button value=Search onClick='javascript:
poponload()'>")
document.write ("</form>")
but I don't know how to retrieve the values in the emplist.aspx page.
the page opens but I can't retrieve the values.
not 100% sure what you mean, but it sounds like you're trying to get
two windows to talk to each other.
the original window has access to the window it opened via the
testwindow variable. the problem is, you dont really know when that
window is done loading, so you cant except code you put in the next
line after "testwindow= window.open..." to be working with the fully-
loaded emplist.aspx
what i usually do is have the window that popped tell the original
window that it's done loading. to do that, add this line of code after
the window.open():
testwindow.opener = window;
then the javascript code in your emplist.aspx page will have access to
the original window by using window.opener. so if you had a function
called foo() in your original file, your emplist.aspx file could call
that function by calling window.opener.foo()
you could either have emplist.aspx send data to the original file
through a parameter to a function like foo(), or you could just use
foo() as a sort-of checkpoint that tells the original file that
emplist.aspx is done loading and you can start getting data from it.
thanks for responding...
I'm trying to pass.....
emplist.aspx?Fname=form.fname
to another page.
function poponload()
{
testwindow= window.open ("http://amp/emplist.aspx?Fname=form.fname",
"mywindow",
"location=1,status=1,scrollbars=1,width=600,height =600");
testwindow.moveTo(0,0);
}
document.write ("<form method=post>")
document.write ("<input type=text name=fname>")
document.write ("<input type=button value=Search onClick='javascript :
poponload()'>")
document.write ("</form>")
On Apr 5, 4:00 pm, brunascle.m...@gmail.com wrote:
On Apr 5, 3:40 pm, vnc...@hotmail.com wrote:
I have this home.js file and I'm trying to collect the values on the
other at "emplist.aspx"
function poponload()
{
testwindow= window.open ("emplist.aspx", "mywindow",
"location=1,status=1,scrollbars=1,width=600,height =600");
testwindow.moveTo(0,0);
}
document.write ("<form action=http://www.espn.commethod=post>")
document.write ("<input type=text>")
document.write ("<input type=button value=Search onClick='javascript:
poponload()'>")
document.write ("</form>")
but I don't know how to retrieve the values in the emplist.aspx page.
the page opens but I can't retrieve the values.
not 100% sure what you mean, but it sounds like you're trying to get
two windows to talk to each other.
the original window has access to the window it opened via the
testwindow variable. the problem is, you dont really know when that
window is done loading, so you cant except code you put in the next
line after "testwindow= window.open..." to be working with the fully-
loaded emplist.aspx
what i usually do is have the window that popped tell the original
window that it's done loading. to do that, add this line of code after
the window.open():
testwindow.opener = window;
then the javascript code in your emplist.aspx page will have access to
the original window by using window.opener. so if you had a function
called foo() in your original file, your emplist.aspx file could call
that function by calling window.opener.foo()
you could either have emplist.aspx send data to the original file
through a parameter to a function like foo(), or you could just use
foo() as a sort-of checkpoint that tells the original file that
emplist.aspx is done loading and you can start getting data from it.- Hide quoted text -
- Show quoted text -
Ok, I'm making some headway with
urlStr = "http://amp/emplist.aspx?Fname="+document.form.fname,
"mywindow","location=1,status=1,scrollbars=1,width =600,height=600";
function poponload()
{
testwindow= window.open (urlStr);
testwindow.moveTo(0,0);
}
document.write ("<form method=post>")
document.write ("<input type=text name=fname>")
document.write ("<input type=button value=Search onClick='javascript:
poponload()'>")
document.write ("</form>")
but I'm getting this.... "document.form.fname is null or not an
object!!!
Assistance???
Thanks, vn****@hotmail.com said:
> Ok, I'm making some headway with
urlStr = "http://amp/emplist.aspx?Fname="+document.form.fname, "mywindow","location=1,status=1,scrollbars=1,widt h=600,height=600"; function poponload() {
testwindow= window.open (urlStr); testwindow.moveTo(0,0); }
document.write ("<form method=post>") document.write ("<input type=text name=fname>") document.write ("<input type=button value=Search onClick='javascript: poponload()'>") document.write ("</form>")
but I'm getting this.... "document.form.fname is null or not an object!!!
I don't think you're really making much headway.
You're getting that error because document.form.fname doesn't exist
at the time that you're trying to concatenate it into your urlStr
variable. If it did exist, it wouldn't be a string, so it doesn't
really make any sense to try to append it to the URL, anyway.
Why are you using document.write() to create a form that doesn't
have any dynamic content? Why not just use simple HTML?
If the window that opens your emplist.aspx page contains a form
named "fname", then the emplist.aspx page can access that form as:
window.opener.forms["fname"]
You don't need to pass anything to the new page for that to work.
If you need to pass it the name of the form, then you need to pass
the *name*, not a reference to the form.
--
The reason I'm using document.write() is because I'm using Team
Services to create these online resources and the only way to post
values from a form is to use JavaScript. The old fashion
<form>
<input type>
<input type=submit>
doesn't work. http://blahblah/test.html?fname=
I keep getting undefined...
function poponload()
{
if (document.forms['fname'] != null)
{
urlStr = "http://192.168.14.13/test.html?
fname="+document.forms['fname'],
"mywindow","location=1,status=1,scrollbars=1,width =100,height=100";
}
else
{
urlStr = "http://192.168.14.13/test.html?
fname=1",
"mywindow","location=1,status=1,scrollbars=1,width =100,height=100";
}
testwindow= window.open (urlStr);
testwindow.moveTo(0,0);
}
document.write ("<form method=post>")
document.write ("<input type=text name=fname>")
document.write ("<input type=button value=Search onClick='javascript :
poponload()'>")
document.write ("</form>") vn****@hotmail.com said:
> The reason I'm using document.write() is because I'm using Team Services to create these online resources and the only way to post values from a form is to use JavaScript. The old fashion
<form> <input type> <input type=submit>
doesn't work. http://blahblah/test.html?fname= I keep getting undefined... function poponload() {
if (document.forms['fname'] != null)
{
urlStr = "http://192.168.14.13/test.html? fname="+document.forms['fname'],
Again, you do not want to append document.forms['fname'] to your URL.
You're trying to append a reference to the form where you seem to
want to append *the name* of the form.
After finally actually looking at your poponload() function,
it doesn't really make any sense. You're trying to create
urlStr as a triple of comma-separated values.
function poponload()
{
if (document.forms['fname'] != null)
{
urlStr = "http://192.168.14.13/test.html?fname="
+document.forms['fname'],
"mywindow",
"location=1,status=1,scrollbars=1,width=100,height =100";
}
else
{
urlStr = "http://192.168.14.13/test.html?fname=1",
"mywindow",
"location=1,status=1,scrollbars=1,width=100,height =100";
}
testwindow= window.open (urlStr);
testwindow.moveTo(0,0);
}
I suspect that what you really want is something like:
function poponload() {
window.open("http://192.168.14.13/test.html?fname=fname",
"mywindow",
"location,status,scrollbars,width=100,height=1 00"
+"screenX=0,screenY=0,resizable");
}
-- This discussion thread is closed Replies have been disabled for this discussion. Similar topics
3 posts
views
Thread by domeceo |
last post: by
|
2 posts
views
Thread by Morgan |
last post: by
|
2 posts
views
Thread by craigkenisston |
last post: by
|
1 post
views
Thread by olduncleamos |
last post: by
|
11 posts
views
Thread by John Pass |
last post: by
|
2 posts
views
Thread by o1j2m3 |
last post: by
|
1 post
views
Thread by vncntj |
last post: by
| |
2 posts
views
Thread by csmith8933 |
last post: by
| | | | | | | | | | | |