sanity check: onClick not loading frame? (IE/NS)

A

Alexandra

Not sure why none of these permutations are working. I appreciate a
second set of eyes!

Code:
....
<form id="form1" name="form1" >
....
<input name="Submit1" type="submit" tabindex="10"
onClick="parent.mainFrame.location.href='SelectSystem.html';"
value="Done" />
<input name="Submit2" type="submit" tabindex="10"
onClick="parent.mainFrame.location='SelectSystem.html';" value="Done"
/>
<input name="Submit3" type="submit" tabindex="10"
onClick="parent.frames['mainFrame'].location.href='SelectSystem.html';"
value="Done" />

The frameset is defined as such:
Code:
<frameset rows="161,*" cols="*" frameborder="no" border="0"
framespacing="0">
<frame src="TitleBarContent.html" name="topFrame" scrolling="No"
noresize="noresize" id="topFrame" title="TopFrame" />
<frameset rows="*" cols="164,*" framespacing="0" frameborder="no"
border="0">
<frame src="LeftNavContent.html" name="leftFrame" scrolling="No"
noresize="noresize" id="leftFrame" title="LeftFrame" />
<frame src="SelectSystem.html" name="mainFrame" id="mainFrame"
title="MainFrame" />
</frameset>
</frameset>

Many thanks to those with a sharp eye!

--Alexandra
 
B

Bart Van der Donck

Alexandra said:
Not sure why none of these permutations are working. I appreciate a
second set of eyes!
[snip code]

Your code should work, though it's not ideally constructed. Please
consider using <input type="button"> in stead of <input
type="submit"> . Also, the closing </form> tag is missing.

But you can keep this more down to earth; I'ld do something like

<form method="get" action="SelectSystem.html" target="mainFrame">
<input type="submit" value="Done">
</form>
 
A

Alexandra

Thank you Bart!

I knew I was forgetting something VERY fundamental, and that was it.
(Haven't done JS in about 3 years.) Changing the type from "submit" to
"button" was exactly the solution.

I would put the link in the action, but have 5 buttons each going to a
different place (mockup purposes).

Thanks again!

--Alexx
Alexandra said:
Not sure why none of these permutations are working. I appreciate a
second set of eyes!
[snip code]

Your code should work, though it's not ideally constructed. Please
consider using <input type="button"> in stead of <input
type="submit"> . Also, the closing </form> tag is missing.

But you can keep this more down to earth; I'ld do something like

<form method="get" action="SelectSystem.html" target="mainFrame">
<input type="submit" value="Done">
</form>
 
B

Bart Van der Donck

Alexandra said:
Thank you Bart!
I knew I was forgetting something VERY fundamental, and that was it.
(Haven't done JS in about 3 years.) Changing the type from "submit" to
"button" was exactly the solution.

I would put the link in the action, but have 5 buttons each going to a
different place (mockup purposes).

No problem, but maybe you're referring to line breaks that may appear
between different <form>..</form> calls. One workaround:

<table>
<tr>
<form method="get" action="fileONE.html" target="mainFrame">
<td>
<input type="submit" value="Done">
</td>
</form>
<form method="get" action="fileTWO.html" target="mainFrame">
<td>
<input type="submit" value="Done">
</td>
</form>
</tr>
Thanks again!

My pleasure !
 
R

RobG

Bart said:
No problem, but maybe you're referring to line breaks that may appear
between different <form>..</form> calls. One workaround:

<table>
<tr>
<form method="get" action="fileONE.html" target="mainFrame">

A form can't be a child of a TR element, the HTML is invalid.

[...]
 
B

Bart Van der Donck

RobG said:
[...]
A form can't be a child of a TR element, the HTML is invalid.

Depends on how your document defines "invalid HTML". Using something
like

<!DOCTYPE HTML SYSTEM "http://www.dotinternet.be/temp/my.dtd">

should be okay (= the HTML 4.0 Transitional DTD with altered lines 655
and 843 in order to allow FORM between TR and TD).
 
R

RobG

Bart said:
RobG said:
[...]
A form can't be a child of a TR element, the HTML is invalid.

Depends on how your document defines "invalid HTML". Using something
like

<!DOCTYPE HTML SYSTEM "http://www.dotinternet.be/temp/my.dtd">

should be okay (= the HTML 4.0 Transitional DTD with altered lines 655
and 843 in order to allow FORM between TR and TD).

Look again at the code the OP posted - a munge of faux XHTML with
mixed-case attribute names. I can pretty much guarantee that the
inference of a bespoke transitional DTD slipped by completely unoticed.
:)
 
B

Bart Van der Donck

RobG said:
[...]
Look again at the code the OP posted - a munge of faux XHTML with
mixed-case attribute names. I can pretty much guarantee that the
inference of a bespoke transitional DTD slipped by completely unoticed.
:)

Very true. But since we're dealing with a beautiful lady here, I
formulated that in another post as "not ideally constructed" :)
 
M

Michael Winter

Depends on how your document defines "invalid HTML".

[snip]

Theoretically, yes, but before even thinking about custom DTDs, it's
important to consider how browsers really behave. After all, they work
to their own idea of HTML - trying to create your own definition is
pointless - and triggering error correction in a case such as this might
be disastrous.

The reasoning behind adopting valid HTML 4.01 is that no browser should
deem it necessary to perform error correction, therefore the document
tree is predictable. This is important for both scripting, and in cases
where elements should have a specific relationship with other elements
(such as form controls and their containing form). For instance, the
document tree in Firefox is thoroughly distorted: the form elements are
siblings of the table cells, and the form controls don't have a form
ancestor at all. Luckily for you, the controls are still associated with
the right form.

There's no justification here for not inserting the form elements in the
right place - within the table cells. An alternative is to use just a
single form, and have the server determine the destination based upon
the submitted data (the name/value pair of the activated submit button).

Mike
 
B

Bart Van der Donck

Michael said:
[...]
The reasoning behind adopting valid HTML 4.01 is that no browser should
deem it necessary to perform error correction, therefore the document
tree is predictable. This is important for both scripting, and in cases
where elements should have a specific relationship with other elements
(such as form controls and their containing form). For instance, the
document tree in Firefox is thoroughly distorted: the form elements are
siblings of the table cells, and the form controls don't have a form
ancestor at all. Luckily for you, the controls are still associated with
the right form.

There's no justification here for not inserting the form elements in the
right place - within the table cells. An alternative is to use just a
single form, and have the server determine the destination based upon
the submitted data (the name/value pair of the activated submit button).

Yes. Just putting <form></form> inside each <td></td> is the solution
here. My suggestion was rather an academic exercise; you can validate
almost anything with bespoke DTD's.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top