The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 16, 2019, 11:43:30 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: event firing on iframed form submit?  (Read 3974 times)
svakanda
Expert
****
Offline Offline

Posts: 131



View Profile
« on: October 12, 2009, 01:02:47 PM »

I have some iframed forms that are 3rd party, and I'm wondering if my javascript on the page that is doing the iframing is capable of detecting when that form(within the iframe) is submitted.  Also am I able to read information from the inputs within that iframe with javascript?

If this is possible, could someone just point me in a general direction, like which functions I should investigate or something? 

Thanks!
Sva
Logged

a ship is safe in the harbor, but that's not what it's for.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: October 12, 2009, 02:44:27 PM »

If it's not your domain, probably not: consider what would happen if you (a javascripter) could iFrame a bank's website.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
svakanda
Expert
****
Offline Offline

Posts: 131



View Profile
« Reply #2 on: October 12, 2009, 03:41:56 PM »

My understanding of javascript is rather infantile, but I know the GodCPA software has some method of doing this..."redirecting a page based off of a user submitting an iframed form"...admittedly I have no idea how.

Could the javascript be detecting the user click(which fires off the form) in the spatial area surrounding the iframe?
Logged

a ship is safe in the harbor, but that's not what it's for.
DangerMouse
Expert
****
Offline Offline

Posts: 244



View Profile
« Reply #3 on: October 12, 2009, 04:05:10 PM »

Interesting stuff I would go with Perk and suggest that without the iFramed content being already comprimised somehow it's not possible to control the contents of an iFrame externally based on same origin policy rules. I guess it may be possible with browser bugs but I'd like to think any that are that serious have been ironed out long ago.

Just read the sales page for "GodCPA" - lol damn do I hate sales pages - but I can't quite see the reference your mention. My suggestion would be that they can cause a redirection on form submit by frame breaking the iFrame as the form is ultimately hosted on a page you control.

DM
Logged
svakanda
Expert
****
Offline Offline

Posts: 131



View Profile
« Reply #4 on: October 12, 2009, 04:35:40 PM »

Using GodCPA, you can iframe an email submit...so the top.location is still your page obviously...then when they submit the email submit it can redirect the user to a new location.  That is what I am getting at.

It doesn't have to affect anything inside the iframe, or modify the data.

Otherwise, like right now what I am doing, is the user submits the iframed email submit, and it takes them to page2 on iframe(but they usually cant really see it anyway), and the top.location (my page which is doing the framing) just sits there.

I'd love to figure out a way to redirect my top.location somewhere else after that is submitted.

S
Logged

a ship is safe in the harbor, but that's not what it's for.
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #5 on: October 12, 2009, 06:07:14 PM »

You can not change the contentDocument of an iframe unless the parent is from the same domain.
As in the contentDocument and contentWindow of an iframe are read only.

But theoretically you can add an event listener to the contentWindow of the iframe to detect a click.
And u can also check the document.location of the iframe.
So have a poll check document.location of iframe

But if u change top.location the iframe will be "gone" since there is a page reload.
So either detect the click in the iframe or document.location of iframe.

When the location of iframe changes.
Change the content in ur top using JS and Ajax (or what ever u want to use).
Logged
svakanda
Expert
****
Offline Offline

Posts: 131



View Profile
« Reply #6 on: October 13, 2009, 07:34:14 AM »

You can not change the contentDocument of an iframe unless the parent is from the same domain.
As in the contentDocument and contentWindow of an iframe are read only.

But theoretically you can add an event listener to the contentWindow of the iframe to detect a click.
And u can also check the document.location of the iframe.
So have a poll check document.location of iframe

But if u change top.location the iframe will be "gone" since there is a page reload.
So either detect the click in the iframe or document.location of iframe.

When the location of iframe changes.
Change the content in ur top using JS and Ajax (or what ever u want to use).

thankyou NOP!!!
that is exactly what I wanted to know.
Logged

a ship is safe in the harbor, but that's not what it's for.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #7 on: October 13, 2009, 08:21:21 AM »

This will be interesting, because top.location will not change if the action is a straight POST. This will be interesting to see how you make out Sva.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
svakanda
Expert
****
Offline Offline

Posts: 131



View Profile
« Reply #8 on: October 13, 2009, 08:33:59 AM »

I think all I need to do is poll the document.location of the iframe, and when it changes from the first page, then I can redirect the top.location wherever I want it.
Logged

a ship is safe in the harbor, but that's not what it's for.
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #9 on: October 13, 2009, 05:26:13 PM »

This will be interesting, because top.location will not change if the action is a straight POST. This will be interesting to see how you make out Sva.
As usual I spout useless shit most of the time.
Anyway if u filter the useless shit  ROFLMAO ROFLMAO ROFLMAO

Basically u have an iframe with a post form lets say.
You either listen for location of iframe (by polling) to change or maybe u can detect the click on the form button.

Then u do not redirect the "top", you just change the content with JS.
If u redirect the top, then the iframe will reload.
Logged
svakanda
Expert
****
Offline Offline

Posts: 131



View Profile
« Reply #10 on: October 13, 2009, 06:31:38 PM »

See though, after the submit inside the iframe fires, I don't even care about the iframe any longer...it's old news, and can be left in the dust.

Logged

a ship is safe in the harbor, but that's not what it's for.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!