I have a javascript that makes a popup with a javscript function in it.
The function in the popup after 5 seconds tries to change the "price" field value in the opener window:
Expand|Select|Wrap|Line Numbers
- sourze= "<script type=%20text/javascript%20>
- function change(){ window.opener.document.forms[0].price.value=123;};
- setTimeout('change()',5000);</script>";
- thepopup=window.open( '' , 'name' , 'height=5,width=5');
- logs.document.writeln(sourze);
BUT..
Im trying to launch this script from one page and the "price" field is in another page. So I add to this code one more line
Expand|Select|Wrap|Line Numbers
- window.location="http://www.anotherpage.com";
The whole script looks like this:
Expand|Select|Wrap|Line Numbers
- sourze= "<script type=%20text/javascript%20>
- function change(){ window.opener.document.forms[0].price.value=123;};
- setTimeout('change()',5000);</script>";
- thepopup=window.open( '' , 'name' , 'height=5,width=5');
- logs.document.writeln(sourze);
- window.location="http://www.anotherpage.com";