Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 17th, 2006, 06:25 AM
Alexandra
Guest
 
Posts: n/a
Default sanity check: onClick not loading frame? (IE/NS)

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

Expand|Select|Wrap|Line Numbers
  1. ....
  2. <form id="form1" name="form1" >
  3. ....
  4. <input name="Submit1" type="submit" tabindex="10"
  5. onClick="parent.mainFrame.location.href='SelectSystem.html';"
  6. value="Done" />
  7. <input name="Submit2" type="submit" tabindex="10"
  8. onClick="parent.mainFrame.location='SelectSystem.html';" value="Done"
  9. />
  10. <input name="Submit3" type="submit" tabindex="10"
  11. onClick="parent.frames['mainFrame'].location.href='SelectSystem.html';"
  12. value="Done" />
  13.  
The frameset is defined as such:
Expand|Select|Wrap|Line Numbers
  1. <frameset rows="161,*" cols="*" frameborder="no" border="0"
  2. framespacing="0">
  3. <frame src="TitleBarContent.html" name="topFrame" scrolling="No"
  4. noresize="noresize" id="topFrame" title="TopFrame" />
  5. <frameset rows="*" cols="164,*" framespacing="0" frameborder="no"
  6. border="0">
  7. <frame src="LeftNavContent.html" name="leftFrame" scrolling="No"
  8. noresize="noresize" id="leftFrame" title="LeftFrame" />
  9. <frame src="SelectSystem.html" name="mainFrame" id="mainFrame"
  10. title="MainFrame" />
  11. </frameset>
  12. </frameset>
  13.  
Many thanks to those with a sharp eye!

--Alexandra


  #2  
Old August 17th, 2006, 11:35 AM
Bart Van der Donck
Guest
 
Posts: n/a
Default Re: sanity check: onClick not loading frame? (IE/NS)

Alexandra wrote:
Quote:
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>

--
Bart

  #3  
Old August 17th, 2006, 11:55 AM
Alexandra
Guest
 
Posts: n/a
Default THANK YOU! "button" vs "submit"

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

Bart Van der Donck wrote:
Quote:
Alexandra wrote:
>
Quote:
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>
>
--
Bart
  #4  
Old August 17th, 2006, 12:15 PM
Bart Van der Donck
Guest
 
Posts: n/a
Default Re: THANK YOU! "button" vs "submit"

Alexandra wrote:
Quote:
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>..</formcalls. 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>
</table>
Quote:
Thanks again!
My pleasure !

--
Bart

  #5  
Old August 17th, 2006, 01:15 PM
RobG
Guest
 
Posts: n/a
Default Re: THANK YOU! "button" vs "submit"


Bart Van der Donck wrote:
Quote:
Alexandra wrote:
>
Quote:
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>..</formcalls. 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.

[...]

--
Rob

  #6  
Old August 18th, 2006, 08:05 AM
Bart Van der Donck
Guest
 
Posts: n/a
Default Re: THANK YOU! "button" vs "submit"

RobG wrote:
Quote:
[...]
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).

--
Bart

  #7  
Old August 18th, 2006, 02:05 PM
RobG
Guest
 
Posts: n/a
Default Re: THANK YOU! "button" vs "submit"


Bart Van der Donck wrote:
Quote:
RobG wrote:
>
Quote:
[...]
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.
:-)

--
Rob.

  #8  
Old August 18th, 2006, 02:45 PM
Bart Van der Donck
Guest
 
Posts: n/a
Default Re: THANK YOU! "button" vs "submit"

RobG wrote:
Quote:
[...]
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" :-)

--
Bart

  #9  
Old August 18th, 2006, 03:05 PM
Michael Winter
Guest
 
Posts: n/a
Default Re: THANK YOU! "button" vs "submit"

On 18/08/2006 09:15, Bart Van der Donck wrote:
Quote:
RobG wrote:
>
Quote:
>A form can't be a child of a TR element, the HTML is invalid.
>
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
  #10  
Old August 18th, 2006, 03:35 PM
Bart Van der Donck
Guest
 
Posts: n/a
Default Re: THANK YOU! "button" vs "submit"

Michael Winter wrote:
Quote:
[...]
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></forminside each <td></tdis the solution
here. My suggestion was rather an academic exercise; you can validate
almost anything with bespoke DTD's.

--
Bart

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.