Jump to content

Jumpbox


The Praetorian

Recommended Posts

I'm not sure if anyone will be able to solve this one or not, but I figured it couldn't hurt to ask.I use a modified version of phpbb called Categories Hierarchy, and in that they've added a jumpbox similar to the one that Invision uses. The only thing is, the auto-redirect (that is, where it automatically takes you to the board you choose without having to hit "go") doesn't work on Opera. I was just wondering if someone could take a look at the jumpbox and see if there were any obvious reason within the code for this.Don't worry about trying to figure out the switches. If the problem isn't in the javascript portion then I'll try to get it fixed on the help board for CH. Just wanted to see if anyone saw anything obvious. Thanks.

<!-- BEGIN jumpbox --><form method="get" name="jumpbox" action="{jumpbox.S_ACTION}" onsubmit="if(document.jumpbox.{jumpbox.S_NAME}.value < 0){return false;}"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>	<td nowrap="nowrap" align="right"><span class="gensmall">		{jumpbox.L_JUMP_TO}: <select name="{jumpbox.S_NAME}" onchange="if(this.value >= 0){forms['jumpbox'].submit();}"><!-- BEGIN option -->		<option value="{jumpbox.option.VALUE}"<!-- BEGIN selected --> selected="selected"<!-- END selected --><!-- BEGIN disabled --> disabled="disabled"<!-- END disabled -->><!-- BEGIN front --><!-- BEGIN inc -->{jumpbox.option.front.inc.L_INC}<!-- END inc --> <!-- END front -->{jumpbox.option.TEXT}</option>		<!-- END option --></select>  <input type="submit" value="Go" class="liteoption" name="submit" />	</span><input type="hidden" name="sid" value="{jumpbox.SID}" /></td></tr></table></form><br class="nav" /><!-- END jumpbox -->

Link to comment
Share on other sites

Well, it looks like it's using the original version of DOM (document.formname.fieldname.value) rather than the more current versions (document.getElementById('fieldid')), but I do see one possible problem. The onchange event for the select element says:

if(this.value >= 0){	forms['jumpbox'].submit();}

When it probably should be:

if(this.selectedIndex >= 0)

or:

if(this.options[this.selectedIndex].value >= 0)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...