Forum Moderators: open
I have an error massage appearing on a page I have been working on and while it isn't breaking the page it's just plain annoying!
The message is:
Error: Object Required
Code: 0
The code in question is:
<script language="Javascript" type="text/javascript" "styleswitcher.js"></script>
<script language="Javascript" "text/javascript">function submitform(){document.myform.submit();}</script>
<form name="font_select" action="get">
<ul>
<li><a href="javascript: submitform()" onclick="javascript:fontsizeup()" title="Choose a font size that is most comfortable for you. Each click will increase the font size of this page (maximum four clicks)">Font+</a></li>
<li><a href="javascript: submitform()" onclick="javascript:fontsizedown();" title="Choose a font size that is most comfortable for you. Each click will decrease the font size of this page (maximum four clicks)">Font-</a></li>
</ul></form>
Anyone help?
Thanks in advance!
The link that calls
submitform also calls fontsizeup. --------------------
OK. In short. That depends what you mean :)
The page can reload itself. It all depends what your from is submitting to (cgi etc)
Perhaps you could outline what you like to happen generally speaking.
Ok here goes....there are 2 things i'm trying to do here.
The first is allow the user to change the font size of the page using a form to switch between alternative css pages:
<script language="Javascript" type="text/javascript" src="styleswitcher.js"></script>
onclick="javascript:fontsizeup()
onclick="javascript:fontsizedown();
The second thing (and this is where it falls over) is that I am trying to replace the notmal form buttongs with text links:
<script language="Javascript" type="text/javascript">function submitform(){document.self.submit();}</script>
<a href="javascript: submitform()">Font+</a>
<a href="javascript: submitform()"Font-</a>
I know..clear as mud! sorry
<script language="Javascript" type="text/javascript" src="styleswitcher.js"></script>
.......
<a href = "#" onclick="fontsizeup(); return false">Font+</a>
<a href = "#" onclick="fontsizedown();return false">Font-</a> That's OK. I have filled in the elements, and altered a little
- no need for javascript: in onclicks
- return false , to stop the # being followed as a link (page jumps to top)
Now, this bit. You'll have to use separate elements for form submitting.
I'm assuming the form is unrelated to the font-size issue....
The big question is:
What does the form do?
Why does it have "Font+ ¦ -"
You don't need to submit a form to change fontsize.
I suspect that one of us has got the wrong end of the stick, and that could be either of us.
..........
..and perhaps it's me. A quick search reveals a PHP styleswitcher. Is that what's going on? I'll have to have a look.
[edited by: Bernard_Marx at 4:02 pm (utc) on May 19, 2004]
Anyway thanks all and especially Bernard Marx. it now works a treat!
Thanks all again