473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Hierarchy problem (perhaps...)

Hi,

I want to do a click on a picture in an iframe, and i can't manage to
make my function works fine.
Here is the code :

<html>
<head>
<script language="JavaScript" type="text/javascript">
var sHN=1;
var sOnFire=1;
var sUrl=unescape("");
var PageDest=unescape("");
var nRTWB=0;
var sIdFiche=31;
var sOpen=0;

function Clic_iFrame() {
document.SYNTHESE.htmle.submit.click();
}
</script>
<script language="JavaScript" type="text/javascript">
function ClicOnFireNav( ){{if(((sHN==1)&&(sOnFire==1)))
{Clic_iFrame()}}}

function _T0(){{ClicOnFireNav()}_JSL(_PAGE_,"A112","_self", "","")}

</script>
</head>
<BODY topmargin=0 leftmargin=0 bgcolor=#FFFFFF onload="">
<table align=center width=770 height=1299><tr align=left valign=top>
<td>
<div style="position:relative;">
<div style=position:absolute;left:0;top:0;z-index:2;width:770>
<FORM NAME=SYNTHESE ACTION=Dynamic Adress target=_self METHOD=POST>
<TR>
<TD WIDTH=87/><TD COLSPAN=2 id="A113" valign=middle WIDTH=570>
<iframe id="htmle" name="htmle"width=570 height=400
src=http:www.mywebsite/confirm.cgi?action=authorize&pid=31></iframe>
</TD>
<TD WIDTH=95/><TD HEIGHT=400/>
<table>
<tr>
<td width=291 height=50 CLASS=LienGrasCentre id="tzA112" valign=middle
bgcolor=#E5ECF2>
<a name=A112 href="javascript:_T0()" CLASS=LienGrasCentre
ALIGN="CENTER">Consulter le détail &gt;&gt;</a>
</td>
</tr>
</table>
</body>
</html>

I always get the same error : document.SYNTHESE.htmle.submit is not an
object.
Where is the mistake in "Clic_iFrame" function ?

Thanks for your help.

Apr 16 '07 #1
1 1147
paratge wrote:

Hi,
I want to do a click on a picture in an iframe, and i can't manage to
make my function works fine.
Given the fact that your HTML has no less than 17 errors, how could you
expect any javascript to work correctly in such a mutilated structure?

Even if you're not a professional programmer, you should make sure to
develop in decent conditions, otherwise you're bound to encounter
difficult situations that will slow you down.
document.SYNTHESE.htmle.submit.click();
An iframe is not a form element, your seeking a reference this way will
therefore not succeed; you're mixing the FORM tree with some DOM approach.

The first thing that you should do is to find the element on which you
want to click. Since this element is within the iframe, you have to
retrieve a reference to the iframe's window, for instance using the
frames collection, or contentDocument/contentWindow properties, and then
navigate towards your element, using DOM methods.

However, I am not sure that simulating an event is the best way to go;
why not directly call the function referenced by the click attribute?

if(frames["htmle"] && frames["htmle"].func)
frames["htmle"].func() ;

Also, the following entries of the FAQ might help you.

<URL:http://jibbering.com/faq/#FAQ4_8>
<URL:http://jibbering.com/faq/#FAQ4_19>
Apr 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Lasher | last post by:
Hello, I'm trying to write a tool to scrape through some of the Ribosomal Database Project II's (http://rdp.cme.msu.edu/) pages, specifically, through the Hierarchy Browser....
0
by: archway | last post by:
Hi, I would like to build a hierarchy of ProductNode objects like so ProductNode ---Product Node ---ProductNode ------ProductNode ------ProductNode ---ProductNode
9
by: Piotre Ugrumov | last post by:
I would have to implement a class hierarchy. The base class is the class Quadrilateral. The discendents arre th classes Trapezoid, Parallelogram, Rectangle, Square. Quadrilateral |_ Trapezoid...
822
by: Turamnvia Suouriviaskimatta | last post by:
I 'm following various posting in "comp.lang.ada, comp.lang.c++ , comp.realtime, comp.software-eng" groups regarding selection of a programming language of C, C++ or Ada for safety critical...
21
by: Mark Broadbent | last post by:
Consider the following statements //------- Item i = Basket.Items; //indexer is used to return instance of class Item Basket.Items.Remove(); //method on class item is fired item i = new...
2
by: FrankEBailey | last post by:
I've been reading up on Modified Preorder Tree Traversal and it's definitely ideal for the kind of tree structures I need to model for my company's multi-level sales hierarchy. I've implemented the...
3
by: Sean Chambers | last post by:
Hello, I feel that there is a cleaner way to accomplish what I am trying to do. I have 4 different types of classes: -Request --Step ---QuestionSet
3
by: krzysztof.konopko | last post by:
Hello! I want to design a class hierarchy with one base abstract class, let's say CBase. I have a predicate that every object in the class hierarchy must have a parent object of type from this...
11
by: Simon Woods | last post by:
Hi I have this recursive function and I want to walk the inheritance hierarchy to set field values .... the generic T is constrainted as the base class of the inheritance hierarchy Friend...
2
by: Anton Bredikhin | last post by:
Hello! I have a class hierarchy that consists mainly of one base class CtxBase, and two children: LoginCtx and DisconnectCtx. Now, there's a need to provide an interfaces for this hierarchy....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.