[SOLVED] javascript prob

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
mm00re
Forum Newbie
Posts: 13
Joined: Sat Jun 12, 2004 5:56 am

javascript prob

Post by mm00re »

hey to all,

can someone please tell me y this simple script doesnt work:

js console error is;

Code: Select all

Error: window.opener.document.elem has no properties

Code: Select all

function click(colour){		
		  var loc = window.location;
			var arr = new Array();
			arr = loc.toString().split('?');
			elem = arrї1];
			window.opener.document.elem.value = colour;
			window.close();	  
		}
called with

Code: Select all

window.open('../settings/colour_picker.html?colours_form.error_back', 'colour_pop', 'width=300, height=215', '')
here, colours_form is the form name and error_back is a text field

it all works fine if i put this directly into code

also tried to eval the line: eval(window.opener.document.elem.value) = colour;

and still didnt work




many thanx

g00fy
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

try:

Code: Select all

eval('window.opener.document.'+elem+' = colour');
mm00re
Forum Newbie
Posts: 13
Joined: Sat Jun 12, 2004 5:56 am

Post by mm00re »

thank you :D

Code: Select all

function click(colour){		
		  
			var loc = window.location;
			
			var arr = new Array();
			arr = loc.toString().split('?');
			
			var elem = arrї1];	
			eval('window.opener.document.'+elem+'.value = colour');
			
			window.close();	  
		}

kind regards,

g00fy
Post Reply