JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 15th, 2013, 07:56 AM
numele numele is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 numele User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 4 sec
Reputation Power: 0
Other - Add parent form action from child

I am not the greatest on javascript and was hoping someone could give me some help. I am trying to pass to the parent form action field a value from the child. The child is an iframe and they are both in the same domain.

The line I have in the child now which is not working is:
Code:
window.parent.document.forms['stopForm'].action = "command_stop_15264.cgi";


I have also tried:
Code:
window.parent.document.forms['stopForm'].form.action = "command_stop_15264.cgi";
window.parent.document.forms['stopForm'].form.action.value = "command_stop_15264.cgi";



My parent page form is pretty simply:
Code:
<form method="POST" name="stopForm" id="stopForm" target="stopinfo"></form>


Also tried:
Code:
<form method="POST" action="" name="stopForm" id="stopForm" target="stopinfo"></form>

Reply With Quote
  #2  
Old February 15th, 2013, 09:27 PM
web_loone08's Avatar
web_loone08 web_loone08 is online now
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 605 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 16 h 3 m 14 sec
Reputation Power: 69
Do a online search for "same domain iframe communication"; that should give you some good examples of how this is done, but if your testing locally; your going to run into security errors (just so you know in advance).

Reply With Quote
  #3  
Old February 16th, 2013, 09:54 AM
numele numele is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 numele User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 4 sec
Reputation Power: 0
I figured out a way, from the child I send a value to a hidden input on the parent. Worked like a charm.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Other - Add parent form action from child

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap