HTML code works alone, but not with forum Header/Footers
3 posters
Page 1 of 1
HTML code works alone, but not with forum Header/Footers
To help teach myself to write HTML and Javascript better, part of my project is a custom HTML page. So far it works as it should if I launch the .html file from my desktop, or if I upload the page to the forums without the "Do you wish to use your forum page header and page footer ?" option enabled. If I enable this, most of it still works, but the javascript to add options to my drop down box stops working.
I tried adding a prefix to all of the functions, names, and variables in case any of them were in use by the header or footer, but I still have the same problem.
I tried adding a prefix to all of the functions, names, and variables in case any of them were in use by the header or footer, but I still have the same problem.
- Code:
<html>
<body>
<script type="text/javascript">
function doro_addOption(doro_selectbox,doro_text,doro_value)
{
var doro_optn = document.createElement("OPTION");
doro_optn.text = doro_text;
doro_optn.value = doro_value;
doro_selectbox.options.add(doro_optn);
}
function doro_Desc()
{
var doro_desc = document.doro_contractList.doro_Contracts.value;
document.doro_contractDesc.doro_ContractDesc.value = doro_desc;
}
</script>
<center>
<table>
<td>
<form name="doro_contractList">
<select name="doro_Contracts" onchange="doro_Desc()" size="30" style="color:white; background-color:#333333">
</select>
</form>
</td>
<td>
<form name="doro_contractDesc">
<textarea style="color:white; background-color:#333333" rows="30" cols="100" name="doro_ContractDesc" disabled></textarea>
</form>
</td>
</table>
</center>
<script type="text/javascript">
for(var doro_x=0;doro_x<10;doro_x++){
doro_addOption(doro_contractList.doro_Contracts,doro_x,doro_x);
}
</script>
</body>
</html>
Last edited by Zarvis on January 8th 2010, 3:20 am; edited 1 time in total (Reason for editing : Sovled. To work with Firefox the line in the for loop needed to be doro_addOption(document.doro_contractList.doro_Contracts,doro_x,doro_x);)
Zarvis- New Member
- Posts : 4
Reputation : 0
Language : English
Re: HTML code works alone, but not with forum Header/Footers
Hello,
I've just tried it with google chrome and no problem.
Maybe you have let the header and the footer of your page and with another navigator that cause an issue.
Have you tried this code when you enable the page header and footer :
Cordially.
I've just tried it with google chrome and no problem.
Maybe you have let the header and the footer of your page and with another navigator that cause an issue.
Have you tried this code when you enable the page header and footer :
- Code:
<script type="text/javascript">
function doro_addOption(doro_selectbox,doro_text,doro_value)
{
var doro_optn = document.createElement("OPTION");
doro_optn.text = doro_text;
doro_optn.value = doro_value;
doro_selectbox.options.add(doro_optn);
}
function doro_Desc()
{
var doro_desc = document.doro_contractList.doro_Contracts.value;
document.doro_contractDesc.doro_ContractDesc.value = doro_desc;
}
</script>
<center>
<table>
<td>
<form name="doro_contractList">
<select name="doro_Contracts" onchange="doro_Desc()" size="30" style="color:white; background-color:#333333">
</select>
</form>
</td>
<td>
<form name="doro_contractDesc">
<textarea style="color:white; background-color:#333333" rows="30" cols="100" name="doro_ContractDesc" disabled></textarea>
</form>
</td>
</table>
</center>
<script type="text/javascript">
for(var doro_x=0;doro_x<10;doro_x++){
doro_addOption(doro_contractList.doro_Contracts,doro_x,doro_x);
}
</script>
Cordially.
Re: HTML code works alone, but not with forum Header/Footers
I tried again in my normal browser (Firefox) and it still didn't work if I turned on header and footer, however in Internet Explorer it works exactly as it should. I guess it's a Firefox issue then.
Zarvis- New Member
- Posts : 4
Reputation : 0
Language : English
Re: HTML code works alone, but not with forum Header/Footers
Yes I've just try it with firefox and that doesn't work either.
But adding one :
Cordially.
But adding one :
- Code:
document.
- Code:
<script type="text/javascript">
function doro_addOption(doro_selectbox,doro_text,doro_value)
{
var doro_optn = document.createElement("OPTION");
doro_optn.text = doro_text;
doro_optn.value = doro_value;
doro_selectbox.options.add(doro_optn);
}
function doro_Desc()
{
var doro_desc = document.doro_contractList.doro_Contracts.value;
document.doro_contractDesc.doro_ContractDesc.value = doro_desc;
}
</script>
<center>
<table>
<td>
<form name="doro_contractList">
<select name="doro_Contracts" onchange="doro_Desc()" size="30" style="color:white; background-color:#333333">
</select>
</form>
</td>
<td>
<form name="doro_contractDesc">
<textarea style="color:white; background-color:#333333" rows="30" cols="100" name="doro_ContractDesc" disabled>
</textarea>
</form>
</td>
</table>
</center>
<script type="text/javascript">
for(var doro_x=0;doro_x<10;doro_x++){
doro_addOption(document.doro_contractList.doro_Contracts,doro_x,doro_x);
}
</script>
Cordially.
Re: HTML code works alone, but not with forum Header/Footers
Ah, that did it. Thanks.
Zarvis- New Member
- Posts : 4
Reputation : 0
Language : English
Re: HTML code works alone, but not with forum Header/Footers
Okay good ^^
You should try to use firebug ( a firefox module ), it directly told me on what was the error so it was easy to correct it
Good night
You should try to use firebug ( a firefox module ), it directly told me on what was the error so it was easy to correct it
Good night
Re: HTML code works alone, but not with forum Header/Footers
Solved > Locked
ankillien- Energetic
- Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL
Similar topics
» HTML Code works in Page but Not in Post
» html code in post only works in preview
» HTML code for header
» How do you put a link from an HTML pge on teh forum header?
» border works in one forum, but not another, same code was used in both forums
» html code in post only works in preview
» HTML code for header
» How do you put a link from an HTML pge on teh forum header?
» border works in one forum, but not another, same code was used in both forums
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum