Topic: Got a problem

I am deleting everything around the forum like the header and footer so i can build it into my site but now i get this error when posting:
" onLoad="document.getElementById('post').req_message.focus()"

I know this is something from the header.php:

if (isset($form_name) && isset($focus_element))
    echo ' onLoad="document.getElementById(\''.$form_name.'\').'.$focus_element.'.focus()"';

I dont get what the problem is!

Re: Got a problem

Did you by any change open up main.tpl in Dreamweaver? It has been known to mess up the templates. Have a look at the original <body> tag in main.tpl and compare it to the one you have now.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Got a problem

Well i mad this of it:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html dir="<pun_content_direction>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>">
<pun_head>
</head>
<body><pun_body>>

<pun_announcement>

<pun_main>

<pun_footer>

</body>
</html>

But when i put back the normal version it works againa correct :s.

Re: Got a problem

Well now it works i putted it up like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html dir="<pun_content_direction>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>">
<pun_head>
</head>
<body>

<pun_main>

<pun_footer>

</body>
</html>

5 (edited by Paul 2004-03-02 16:14)

Re: Got a problem

If you look at the first version the body tag is marked up incorrectly. You have <body><pun_body>>. Surely it should be <body <pun_body>>
In other words you had <pun_body> outside the <body> tag rather than inside it. I don't know whether or not that would cause the problem. Even though the second version works, does the first field on pages using forms have focus?

Re: Got a problem

Yes, the body tag should be:

<body<pun_body>>

If it's not, the autofocus of certain form elements will not work.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

7

Re: Got a problem

Rickard wrote:

Yes, the body tag should be:

<body> <pun_body>>

Have you not just made the same error as Weccop? main.tpl has it as <body<pun_body>>

Re: Got a problem

Haha, I'm an idiot. I'm gonna edit the previous post.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Got a problem

Thx got it up the way you said it smile.