JavaScript drop-down doesn’t work after page loads

Under the “subjunctivisor” graphic on https://www.lawlessfrench.com/subjunctivisor/ there is a drop-down box based on simple JavaScript: you choose an item and are automatically forwarded to that page.

If you click the drop-down while the page is still loading, it sometimes works. But if you wait until the page fully loads, nothing happens when you click the drop-down – you can’t even make a selection.

Read More

I’ve looked at this with web console but don’t see any obvious errors.

Here’s the relevant part of the script:

<script type="text/javascript">function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != "0") { location=form.select.options[index].value;}} </SCRIPT>
<FORM NAME="form1"> <SELECT NAME="select" ONCHANGE="goto(this.form)" SIZE="1">
<option value="">Choose a verb or expression</option>
<option value="https://www.lawlessfrench.com/subjunctivisor/accepter/">accepter que</option>
<option value="https://www.lawlessfrench.com/subjunctivisor/accorder/">accorder que</option>

(omitted 250 other options)

</select>
</form>

Related posts

2 comments

  1. It appears that your right-click blocker has functions to disable select elements (for some strange reason). Remove it because it doesn’t do you any good anyway.

    Look for this function in particular (and its IE equivalent):

    function disableselect(e) { ... }
    

    It resides in an inline script tag that looks like this:

    <script type="text/rocketscript" data-rocketoptimized="true">
    

    Update: I may have misinterpreted what that function does. It’s worth a try removing it, however.

  2. Solution: the Content Copy Protection & Prevent Image Save plugin had an option to disable selection. Once I unchecked that option, the js worked.

Comments are closed.