Current location: Hot Scripts Forums » General Web Coding » JavaScript » Auto Clicking Form Button, Within IFRAME


Auto Clicking Form Button, Within IFRAME

Reply
  #1 (permalink)  
Old 09-05-07, 09:15 PM
desdev desdev is offline
New Member
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Auto Clicking Form Button, Within IFRAME

I have a form, with a submit box within a IFRAME, what i want to do is control the form from the main window, using javascript i can do this, however the form must have a name set.

Now this is where i am having problems, as teh form has no name set, and there is no way i can change it. Is there any other way to load a webpage into an IFRAME and automatically click the submit field.
Reply With Quote
  #2 (permalink)  
Old 09-06-07, 04:52 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
Javascript Code:
  1. document.forms[0].submit();
The above code will submit the first form it finds in your html code.
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
  #3 (permalink)  
Old 09-21-07, 08:08 AM
nerdcoder nerdcoder is offline
New Member
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
You will probably run into problems here, as many browsers enforce very strict security...
This means you'll probably not be able to "click" the button through javascript, if the iframe source is not from your own domain.

cheers
__________________
----------------------------- My sites -----------------------------
showip.net - does more than the names says
rdebugger.com - remote debugger for JavaScript
mysitemaps.org - automatically create sitemap.xml files
en.relax.dk - my online cv... it's not pretty...
Reply With Quote
  #4 (permalink)  
Old 09-25-07, 04:13 PM
BRIAN_C_C BRIAN_C_C is offline
Newbie Coder
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Something like this should work... you should submit your form for test...

<a onclick="window.parent.blah.blah.blah; return false" href="#" target="_parent">

or framename.whatever... something of this sort....

Last edited by BRIAN_C_C; 09-25-07 at 04:15 PM. Reason: better addressing
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can PHP submit a form without user clicking button? nassau PHP 12 02-22-08 05:04 AM
Auto Submit Form ivan PHP 3 05-30-06 09:37 PM
PHP Form - Button that executes - Need Help Proton PHP 1 02-05-05 10:27 PM
checkCheckboxGroup broken after form consolidation ski_woman JavaScript 0 01-12-05 11:00 AM
targetting a form to an iframe davidklonski JavaScript 2 07-01-04 09:09 AM


All times are GMT -5. The time now is 11:31 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.