Re: [PHP] dynamic boxes problem... JS and PHP

This is a discussion on Re: [PHP] dynamic boxes problem... JS and PHP within the PHP General forums, part of the PHP Programming Forums category; Hey! Thanks Andrew, will look into those points that you sent me. First thing to change will be the DOCTYPE ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008
Ryan S
 
Posts: n/a
Default Re: [PHP] dynamic boxes problem... JS and PHP

Hey!
Thanks Andrew, will look into those points that you sent me.

First thing to change will be the DOCTYPE I think, as i didht type that but must have copied code into a pre-made page...

Cheers!
R

----- Original Message ----
From: Andrew Ballard <aballard@gmail.com>
To: PHP General list <php-general@lists.php.net>
Sent: Tuesday, April 8, 2008 11:18:36 PM
Subject: Re: [php] dynamic boxes problem... JS and PHP

On Tue, Apr 8, 2008 at 3:51 PM, Ryan S <genphp@yahoo.com> wrote:
> Hi Guys,

[snip]
> Andrew:
> Thanks for replying!
>

[snip]
> > Also, FWIW, I doubt it has anything to do with your problem but you
> > are assigning the same value for ID each time through the loop. The ID
> > attribute is supposed to be unique for each element on the page.

>
> Tried changing it, no luck.


I didn't expect it to fix anything related to the problem you posted,
but it is something that should be fixed.


I looked at the HTML source (since I think that's where your problem
is). The problem is that you have <FORM> tags nested inside your table
between two rows:

</tr><form action="process_ecard1.php" method="post" name="mainform">
<tr>

While your nesting is correct insofar as making sure that your <FORM>,
<TABLE>, <TR> and <TD> tags don't cross each other, the <FORM> tag
can't be there. I see why you've done it that way - you have another
form nested inside a cell within the same table (you can't nest one
form within another), and your second form needs to span more than one
cell or row. You need to rethink your page flow and layout so that it
uses valid HTML structure. I don't know if you can combine both forms
into one or if you need to split the table apart.

FWIW, while validating the above solution I found an extra (empty and
unclosed) <TR> tag inside the recipient table which prompted me to run
your HTML through the W3C validator. It found 19 errors that keep it
from validating as XHTML strict as specified in your DOCTYPE. Most of
these won't cause major problems, but the 6th error reported is the
cause of the problem you're having: "document type does not allow
element 'form' here".

Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






__________________________________________________ __________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
Reply With Quote
  #2 (permalink)  
Old 04-08-2008
Daniel Brown
 
Posts: n/a
Default Re: [PHP] dynamic boxes problem... JS and PHP

On Tue, Apr 8, 2008 at 6:20 PM, Ryan S <genphp@yahoo.com> wrote:
> Hey!
> Thanks Andrew, will look into those points that you sent me.
>
> First thing to change will be the DOCTYPE I think, as i didht type that but must have copied code into a pre-made page...


One thing I learned when screwing around with AJAX is that it,
like nearly everything that occurs in nature, must be customized to
play nicely with Microsoft things. Call me bitter. No, seriously, it
could be my new nickname.

<script language="JavaScript">
//Gets the browser specific XmlHttpRequest Object
function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if(window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
} else {
document.getElementById('p_status').innerHTML = 'Status: Cound not
create XmlHttpRequest Object. Consider upgrading your browser.';
}
}
</script>

It's something I had to use when playing around with a chat script
I was building a while ago:
http://pilotpig.net/gchat/

--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008
Bill Guion
 
Posts: n/a
Default Re: [PHP] dynamic boxes problem... JS and PHP

At 3:20 PM -0700 4/8/08, Ryan S wrote:

>Hey!
>Thanks Andrew, will look into those points that you sent me.
>
>First thing to change will be the DOCTYPE I think, as i didht type
>that but must have copied code into a pre-made page...
>
>Cheers!
>R
>


Ryan,

Four observations:

1. Don't try to solve your problem by changing the DOCTYPE. Bad HTML is
bad HTML. Changing the DOCTYPE may reduce the severity of the problem,
but it won't solve it.

2. You have interpreted the fact that IE gave you what you expected while
FF did not as a problem with FF, but the opposite is true. A problem
with IE allowed it to accept HTML that it should not have accepted. FF
treated it properly.

3. Firebug is a free download from Mozilla. I have it and it has solved
more problems for me than I can remember. (Or, maybe I just don't have
a very good memory.) Get it. You will see your <form...> tags inside
the <table> </table> tags, but not inside any <td>...</td> tags.

4. Learn to use the W3C Markup Validation service -
http://validator.w3.org/. It will point out many problems that you can
solve quickly.

-----===== Bill =====-----
--

Murphy's Law Cardinal Conundrum -
The optimist believes we live in the best of all possible worlds.
The pessimist fears this is true.


Reply With Quote
Reply


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

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



All times are GMT +1. The time now is 03:20 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0