JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old May 25th, 2004, 12:06 PM
campbecm campbecm is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 campbecm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Javascript beating me up (Will need helmet soon!)

I have a form that contains an array that I need to be able to create a popup window, select a value in the child window, then on close run the value though a javascript function to insert it into the next available position in the array.

My function on the parent window looks like so:

Code:
 
function setCode(theBox){
  elem = document.entry.elements;
  for(i=0;i<elem.length;i++){
	if(elem[i].name.match(/test\d+/)){
	  if(theBox.value==elem[i].value){
		if(theBox.checked==false){
		  elem[i].value = "";
		  closeGap(elem[i]);
		}
		return false;
	  }
	  if(elem[i].value=="" && theBox.checked==true){
		elem[i].value=theBox.value;
		return false;
	  }
	}
  }
  return false;
}


My child page contains the following:

I query the database for all tests that match their criteria then allow them to click on a checkbox to select the test. I then need to close the child page, run the checked test through the array on the parent page.

I have been beating my head against the wall for days on this one!

Reply With Quote
  #2  
Old May 26th, 2004, 07:48 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
I couldn't really understand your problem exactly......... if the problem is calling the setCode func FROM the child, use the window.opener method.... e.g.
Code:
window.opener.setCode(foo)
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Javascript beating me up (Will need helmet soon!)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway